TestsController.php in Bamboo Twig 8.2
File
tests/modules/bamboo_twig_test/src/Controller/TestsController.php
View source
<?php
namespace Drupal\bamboo_twig_test\Controller;
use Drupal\Core\Controller\ControllerBase;
use DateTime;
use Drupal\Component\Datetime\DateTimePlus;
use Drupal\Core\Datetime\DrupalDateTime;
class TestsController extends ControllerBase {
public function testLoader() {
return [
'#theme' => 'bamboo_twig_test_loader',
];
}
public function testRender() {
return [
'#theme' => 'bamboo_twig_test_render',
];
}
public function testSecurity() {
return [
'#theme' => 'bamboo_twig_test_security',
];
}
public function testConfig() {
return [
'#theme' => 'bamboo_twig_test_config',
];
}
public function testFile() {
return [
'#theme' => 'bamboo_twig_test_file',
];
}
public function testPath() {
return [
'#theme' => 'bamboo_twig_test_path',
];
}
public function testI18n() {
return [
'#variables' => [
'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',
];
}
public function testExtensions() {
return [
'#theme' => 'bamboo_twig_test_extensions',
];
}
public function testToken() {
return [
'#theme' => 'bamboo_twig_test_token',
];
}
}