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