Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mymodule.something.first:
- route_name: mymodule.something.first
- title: 'Do first thing'
- weight: -20
- appears_on:
- - entity.node.canonical
- mymodule.something.second:
- route_name: mymodule.something.second
- title: 'Do second thing'
- weight: -20
- appears_on:
- - entity.node.canonical
- mymodule.something.first:
- path: '/node/{node}/first'
- defaults:
- _controller: 'DrupalmymoduleControllerModuleController::first'
- _title: 'Do first thing'
- options:
- parameters:
- node:
- type: entity:node
- requirements:
- _permission: 'access content'
- _custom_access: 'DrupalmymoduleControllerModuleController::firstAccess'
- _csrf_token: 'TRUE'
- mymodule.something.second:
- path: '/node/{node}/second'
- defaults:
- _controller: 'DrupalmymoduleControllerSubscriptionController::second'
- _title: 'Do second thing'
- options:
- parameters:
- node:
- type: entity:node
- requirements:
- _permission: 'access content'
- _custom_access: 'DrupalmymoduleControllerSubscriptionController::secondAccess'
- _csrf_token: 'TRUE'
- public function dofirstthing(NodeInterface $node) {
- /* ... some logic ... */
- return $this->redirect('entity.node.canonical', ['node' => $node->id()], ['absolute' => TRUE])->send();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement