value format) * * returns html markup. */ public static function generateAddLinks($baseEntityType, $query = []) { $bundles = \Drupal::service('entity_type.bundle.info')->getBundleInfo($baseEntityType); $markup = ''; foreach($bundles as $bundle_id => $bundle) { $label = $bundle['label']; $url = \Drupal\Core\Url::fromRoute("entity.$baseEntityType.add_form", [$baseEntityType . '_type' => $bundle_id]); $url->setOption('query', $query); $link = \Drupal\Core\Link::fromTextAndUrl(t("Add $label"), $url)->toString(); $markup .= "
$link
"; } return "