TaxonomyController::addForm

public TaxonomyController::addForm(VocabularyInterface $taxonomy_vocabulary)

Returns a form to add a new term to a vocabulary.

Parameters

\Drupal\taxonomy\VocabularyInterface $taxonomy_vocabulary: The vocabulary this term will be added to.

Return value

array The taxonomy term add form.

File

core/modules/taxonomy/src/Controller/TaxonomyController.php, line 24

Class

TaxonomyController
Provides route responses for taxonomy.module.

Namespace

Drupal\taxonomy\Controller

Code

public function addForm(VocabularyInterface $taxonomy_vocabulary) {
  $term = $this->entityManager()->getStorage('taxonomy_term')->create(array('vid' => $taxonomy_vocabulary->id()));
  return $this->entityFormBuilder()->getForm($term);
}
doc_Drupal
2016-10-29 09:46:29
Comments
Leave a Comment

Please login to continue.