function ContrivedController::__construct
Same name in other branches
- 8.x-1.x testing_example/src/Controller/ContrivedController.php \Drupal\testing_example\Controller\ContrivedController::__construct()
- 4.0.x modules/testing_example/src/Controller/ContrivedController.php \Drupal\testing_example\Controller\ContrivedController::__construct()
Construct a new controller.
Parameters
Drupal\Core\StringTranslation\TranslationInterface $translation: The translation service.
File
-
modules/
testing_example/ src/ Controller/ ContrivedController.php, line 32
Class
- ContrivedController
- A highly-contrived controller class used to demonstrate unit testing.
Namespace
Drupal\testing_example\ControllerCode
public function __construct(TranslationInterface $translation) {
$this->setStringTranslation($translation);
}