public function WebformTestEditorialController::index in Webform 6.x
Returns webform help index page.
Return value
array A renderable array containing webform help index page.
1 string reference to 'WebformTestEditorialController::index'
- webform_test_editorial.routing.yml in tests/
modules/ webform_test_editorial/ webform_test_editorial.routing.yml - tests/modules/webform_test_editorial/webform_test_editorial.routing.yml
File
- tests/
modules/ webform_test_editorial/ src/ Controller/ WebformTestEditorialController.php, line 82
Class
- WebformTestEditorialController
- Provides route responses for webform editorial.
Namespace
Drupal\webform_test_editorial\ControllerCode
public function index() {
$path = drupal_get_path('module', 'webform_test_editorial') . '/webform_test_editorial.links.task.yml';
$tasks = Yaml::decode(file_get_contents($path));
$content = [];
foreach ($tasks as $id => $task) {
if (isset($task['parent_id'])) {
$content[$id] = [
'title' => $task['title'],
'description' => $task['description'],
'url' => Url::fromRoute($task['route_name']),
];
}
}
return [
'#theme' => 'admin_block_content',
'#content' => $content,
];
}