public function TestsController::testI18n in Bamboo Twig 8.4
Same name and namespace in other branches
- 8.5 tests/modules/bamboo_twig_test/src/Controller/TestsController.php \Drupal\bamboo_twig_test\Controller\TestsController::testI18n()
- 8.2 tests/modules/bamboo_twig_test/src/Controller/TestsController.php \Drupal\bamboo_twig_test\Controller\TestsController::testI18n()
- 8.3 tests/modules/bamboo_twig_test/src/Controller/TestsController.php \Drupal\bamboo_twig_test\Controller\TestsController::testI18n()
Internationalization page.
1 string reference to 'TestsController::testI18n'
- bamboo_twig_test.routing.yml in tests/
modules/ bamboo_twig_test/ bamboo_twig_test.routing.yml - tests/modules/bamboo_twig_test/bamboo_twig_test.routing.yml
File
- tests/
modules/ bamboo_twig_test/ src/ Controller/ TestsController.php, line 65
Class
- TestsController
- TestsController.
Namespace
Drupal\bamboo_twig_test\ControllerCode
public function testI18n() {
$nodeStorage = $this
->entityTypeManager()
->getStorage('node');
return [
'#variables' => [
'articles' => [
0 => $nodeStorage
->load(1),
1 => $nodeStorage
->load(2),
2 => $nodeStorage
->load(3),
3 => $nodeStorage
->load(4),
4 => $nodeStorage
->load(5),
],
'datetime' => DateTime::createFromFormat('d-m-Y', '24-07-2014'),
'datetimeplus' => DateTimePlus::createFromFormat('d-m-Y', '24-07-2014'),
'drupaldatetime' => DrupalDateTime::createFromFormat('d-m-Y', '24-07-2014'),
],
'#theme' => 'bamboo_twig_test_i18n',
];
}