public function EmptyPages::routes in Empty Page 8
1 string reference to 'EmptyPages::routes'
File
- src/
Routing/ EmptyPages.php, line 16
Class
- EmptyPages
- Defines a route subscriber to register a url from empty pages.
Namespace
Drupal\empty_page\RoutingCode
public function routes() {
$routes = [];
$callbacks = EmptyPageController::emptyPageGetCallbacks();
if (!empty($callbacks)) {
foreach ($callbacks as $cid => $callback) {
$routes['empty_page.page_' . $cid] = new Route($callback['path'], [
'_controller' => '\\Drupal\\empty_page\\Controller\\EmptyPage::emptyCallback',
'_title' => $callback['page_title'],
], [
'_permission' => 'view empty pages',
]);
}
}
return $routes;
}