Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. mymodule.something.first:
  2. route_name: mymodule.something.first
  3. title: 'Do first thing'
  4. weight: -20
  5. appears_on:
  6. - entity.node.canonical
  7.  
  8. mymodule.something.second:
  9. route_name: mymodule.something.second
  10. title: 'Do second thing'
  11. weight: -20
  12. appears_on:
  13. - entity.node.canonical
  14.  
  15. mymodule.something.first:
  16. path: '/node/{node}/first'
  17. defaults:
  18. _controller: 'DrupalmymoduleControllerModuleController::first'
  19. _title: 'Do first thing'
  20. options:
  21. parameters:
  22. node:
  23. type: entity:node
  24. requirements:
  25. _permission: 'access content'
  26. _custom_access: 'DrupalmymoduleControllerModuleController::firstAccess'
  27. _csrf_token: 'TRUE'
  28.  
  29. mymodule.something.second:
  30. path: '/node/{node}/second'
  31. defaults:
  32. _controller: 'DrupalmymoduleControllerSubscriptionController::second'
  33. _title: 'Do second thing'
  34. options:
  35. parameters:
  36. node:
  37. type: entity:node
  38. requirements:
  39. _permission: 'access content'
  40. _custom_access: 'DrupalmymoduleControllerSubscriptionController::secondAccess'
  41. _csrf_token: 'TRUE'
  42.  
  43. public function dofirstthing(NodeInterface $node) {
  44. /* ... some logic ... */
  45.  
  46. return $this->redirect('entity.node.canonical', ['node' => $node->id()], ['absolute' => TRUE])->send();
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement