You are here

public function MenuExampleController::routeOnlyCallback in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/menu_example/src/Controller/MenuExampleController.php \Drupal\menu_example\Controller\MenuExampleController::routeOnlyCallback()

Such callbacks can be user for creating web services in Drupal 8.

1 string reference to 'MenuExampleController::routeOnlyCallback'
menu_example.routing.yml in menu_example/menu_example.routing.yml
menu_example/menu_example.routing.yml

File

menu_example/src/Controller/MenuExampleController.php, line 131

Class

MenuExampleController
Controller routines for menu example routes.

Namespace

Drupal\menu_example\Controller

Code

public function routeOnlyCallback() {
  return [
    '#markup' => $this
      ->t('The route entry has no corresponding menu links entry, so it provides a route without a menu link, but it is the same in every other way to the simplest example.'),
  ];
}