Advertisement
Guest User

Untitled

a guest
Mar 29th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. $route = new Route(
  2. "/{entity}/5/xyz/print",
  3. array(
  4. '_controller' => 'Drupal\xyz\Controller\xyzController::demo1',
  5. '_title' => 'xyz',
  6. ),
  7. array(
  8.  
  9. '_permission' => 'access content',
  10. )
  11. );
  12.  
  13. $collection->add('xyz.show_format.' . $entity_type, $route);
  14.  
  15. //till here exists in routesubscriber.php
  16.  
  17. public function demo1($entity) {
  18. return array(
  19. '#markup' => t('hello World!'),
  20. );
  21. }
  22. //content of controller
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement