Chris@0: entityTypeManager()->getStorage('taxonomy_term')->create(['vid' => $taxonomy_vocabulary->id()]); Chris@0: return $this->entityFormBuilder()->getForm($term); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Route title callback. Chris@0: * Chris@0: * @param \Drupal\taxonomy\VocabularyInterface $taxonomy_vocabulary Chris@0: * The vocabulary. Chris@0: * Chris@0: * @return string Chris@0: * The vocabulary label as a render array. Chris@0: */ Chris@0: public function vocabularyTitle(VocabularyInterface $taxonomy_vocabulary) { Chris@0: return ['#markup' => $taxonomy_vocabulary->label(), '#allowed_tags' => Xss::getHtmlTagList()]; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Route title callback. Chris@0: * Chris@0: * @param \Drupal\taxonomy\TermInterface $taxonomy_term Chris@0: * The taxonomy term. Chris@0: * Chris@0: * @return array Chris@0: * The term label as a render array. Chris@0: */ Chris@0: public function termTitle(TermInterface $taxonomy_term) { Chris@0: return ['#markup' => $taxonomy_term->getName(), '#allowed_tags' => Xss::getHtmlTagList()]; Chris@0: } Chris@0: Chris@0: }