function TableSortExampleController::create

Same name and namespace in other branches
  1. 3.x modules/tablesort_example/src/Controller/TableSortExampleController.php \Drupal\tablesort_example\Controller\TableSortExampleController::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/tablesort_example/src/Controller/TableSortExampleController.php, line 24

Class

TableSortExampleController
Controller routines for tablesort example routes.

Namespace

Drupal\tablesort_example\Controller

Code

public static function create(ContainerInterface $container) {
    $controller = new static($container->get('database'));
    $controller->setStringTranslation($container->get('string_translation'));
    return $controller;
}