function PagerExamplePage::create

Same name and namespace in other branches
  1. 3.x modules/pager_example/src/Controller/PagerExamplePage.php \Drupal\pager_example\Controller\PagerExamplePage::create()

Instantiates a new instance of the implementing class using autowiring.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container this instance should use.

Return value

static

Overrides AutowireTrait::create

File

modules/pager_example/src/Controller/PagerExamplePage.php, line 50

Class

PagerExamplePage
Controller for pager_example.page route.

Namespace

Drupal\pager_example\Controller

Code

public static function create(ContainerInterface $container) {
  $controller = new static($container->get('entity_type.manager')
    ->getStorage('node'), $container->get('current_user'));
  $controller->setStringTranslation($container->get('string_translation'));
  return $controller;
}