You are here

public function ForumController::addContainer in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/forum/src/Controller/ForumController.php \Drupal\forum\Controller\ForumController::addContainer()

Returns add container entity form.

Return value

array Render array for the add form.

1 string reference to 'ForumController::addContainer'
forum.routing.yml in core/modules/forum/forum.routing.yml
core/modules/forum/forum.routing.yml

File

core/modules/forum/src/Controller/ForumController.php, line 268

Class

ForumController
Controller routines for forum routes.

Namespace

Drupal\forum\Controller

Code

public function addContainer() {
  $vid = $this
    ->config('forum.settings')
    ->get('vocabulary');
  $taxonomy_term = $this->termStorage
    ->create([
    'vid' => $vid,
    'forum_container' => 1,
  ]);
  return $this
    ->entityFormBuilder()
    ->getForm($taxonomy_term, 'container');
}