Please Disable Your Browser Adblock Extension for our site and Refresh This Page!

our ads are user friendly, we do not serve popup ads. We serve responsible ads!

Refresh Page
Skip to main content
On . By CodimTh

All keys under the defaults section which do not start with an underscore will be passed in as arguments to the controller. Name your arguments appropriately for the arguments of the controller. For example a mymodule.routing.yml file with the following:

  path: '/mymodule'
    _controller: '\Drupal\mymodule\Controller\MyModuleController::content'
    uid: 1
    _permission: 'access content' 


Will pass on $uid to the controller, so your content method can take $uid:

// ...
public function content($uid) {
  // Now you can use $uid 


Add new comment

Restricted HTML


Page Facebook

Become a patron

If you need some help or you search a Drupal freelancer don't hesitate to contact us.


Contact Us

All the content is FREE but I still need your help


Become a patreon