You are here

public function WebformEditorialController::index in Webform 8.5

Returns webform help index page.

Return value

array A renderable array containing webform help index page.

1 string reference to 'WebformEditorialController::index'
webform_editorial.routing.yml in modules/webform_editorial/webform_editorial.routing.yml
modules/webform_editorial/webform_editorial.routing.yml

File

modules/webform_editorial/src/Controller/WebformEditorialController.php, line 113

Class

WebformEditorialController
Provides route responses for webform editorial.

Namespace

Drupal\webform_editorial\Controller

Code

public function index() {
  $path = drupal_get_path('module', 'webform_editorial') . '/webform_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,
  ];
}