function ForumController::create

Same name in other branches
  1. 9 core/modules/forum/src/Controller/ForumController.php \Drupal\forum\Controller\ForumController::create()
  2. 8.9.x core/modules/forum/src/Controller/ForumController.php \Drupal\forum\Controller\ForumController::create()
  3. 10 core/modules/forum/src/Controller/ForumController.php \Drupal\forum\Controller\ForumController::create()

Overrides AutowireTrait::create

File

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

Class

ForumController
Controller routines for forum routes.

Namespace

Drupal\forum\Controller

Code

public static function create(ContainerInterface $container) {
    
    /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */
    $entity_type_manager = $container->get('entity_type.manager');
    return new static($container->get('forum_manager'), $entity_type_manager->getStorage('taxonomy_vocabulary'), $entity_type_manager->getStorage('taxonomy_term'), $container->get('current_user'), $entity_type_manager->getAccessControlHandler('node'), $container->get('entity_field.manager')
        ->getFieldMap(), $entity_type_manager->getStorage('node_type'), $container->get('renderer'), $entity_type_manager->getDefinition('node'), $entity_type_manager->getDefinition('comment'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.