public function TestController::test in Twig Extender 8
Same name and namespace in other branches
- 8.2 twig_extender_tests/src/Controller/TestController.php \Drupal\twig_extender_tests\Controller\TestController::test()
Test.
Return value
string Return Hello string.
1 string reference to 'TestController::test'
- twig_extender_tests.routing.yml in twig_extender_tests/
twig_extender_tests.routing.yml - twig_extender_tests/twig_extender_tests.routing.yml
File
- twig_extender_tests/
src/ Controller/ TestController.php, line 18
Class
- TestController
- Class TestController.
Namespace
Drupal\twig_extender_tests\ControllerCode
public function test() {
$nodes = \Drupal::entityManager()
->getStorage('node')
->loadMultiple();
$build = [
'#type' => 'container',
'#childrends' => [],
];
foreach ($nodes as $node) {
$build['#children'][] = [
'#theme' => 'twig_extender_test_node',
'#node' => $node,
];
$build['#children'][] = [
'#theme' => 'twig_extender_test_node',
'#node' => $node
->toUrl(),
];
}
return $build;
}