Skip to main content
replaced http://drupal.stackexchange.com/ with https://drupal.stackexchange.com/
Source Link

I tested this out, and it doesn't work in Drupal 8, unfortunately.

mymodule.test:
  path: '/mymodule/{testparam}'
  defaults:
    _controller: '\Drupal\mymodule\Controller\TestController::build'
    _title: 'Variable Parameter'
  requirements:
    _permission: 'access content'
    testparam: .+

It picks up the route with "/mymodule/hello", but not "/mymodule/hello/world".

There's some more discussion of this here: Slashes in single route parameter or other ways to handle a menu tail with dynamic number of paramsSlashes in single route parameter or other ways to handle a menu tail with dynamic number of params

It looks like there's a solution, but it's pretty heavy handed.

I tested this out, and it doesn't work in Drupal 8, unfortunately.

mymodule.test:
  path: '/mymodule/{testparam}'
  defaults:
    _controller: '\Drupal\mymodule\Controller\TestController::build'
    _title: 'Variable Parameter'
  requirements:
    _permission: 'access content'
    testparam: .+

It picks up the route with "/mymodule/hello", but not "/mymodule/hello/world".

There's some more discussion of this here: Slashes in single route parameter or other ways to handle a menu tail with dynamic number of params

It looks like there's a solution, but it's pretty heavy handed.

I tested this out, and it doesn't work in Drupal 8, unfortunately.

mymodule.test:
  path: '/mymodule/{testparam}'
  defaults:
    _controller: '\Drupal\mymodule\Controller\TestController::build'
    _title: 'Variable Parameter'
  requirements:
    _permission: 'access content'
    testparam: .+

It picks up the route with "/mymodule/hello", but not "/mymodule/hello/world".

There's some more discussion of this here: Slashes in single route parameter or other ways to handle a menu tail with dynamic number of params

It looks like there's a solution, but it's pretty heavy handed.

added 244 characters in body
Source Link
oknate
  • 14.5k
  • 4
  • 53
  • 98

I tested this out, and it doesn't work in Drupal 8, unfortunately.

mymodule.test:
  path: '/mymodule/{testparam}'
  defaults:
    _controller: '\Drupal\mymodule\Controller\TestController::build'
    _title: 'Variable Parameter'
  requirements:
    _permission: 'access content'
    testparam: .+

It picks up the route with "/mymodule/hello", but not "/mymodule/hello/world".

There's some more discussion of this here: Slashes in single route parameter or other ways to handle a menu tail with dynamic number of params

It looks like there's a solution, but it's pretty heavy handed.

I tested this out, and it doesn't work in Drupal 8, unfortunately.

mymodule.test:
  path: '/mymodule/{testparam}'
  defaults:
    _controller: '\Drupal\mymodule\Controller\TestController::build'
    _title: 'Variable Parameter'
  requirements:
    _permission: 'access content'
    testparam: .+

It picks up the route with "/mymodule/hello", but not "/mymodule/hello/world".

I tested this out, and it doesn't work in Drupal 8, unfortunately.

mymodule.test:
  path: '/mymodule/{testparam}'
  defaults:
    _controller: '\Drupal\mymodule\Controller\TestController::build'
    _title: 'Variable Parameter'
  requirements:
    _permission: 'access content'
    testparam: .+

It picks up the route with "/mymodule/hello", but not "/mymodule/hello/world".

There's some more discussion of this here: Slashes in single route parameter or other ways to handle a menu tail with dynamic number of params

It looks like there's a solution, but it's pretty heavy handed.

Source Link
oknate
  • 14.5k
  • 4
  • 53
  • 98

I tested this out, and it doesn't work in Drupal 8, unfortunately.

mymodule.test:
  path: '/mymodule/{testparam}'
  defaults:
    _controller: '\Drupal\mymodule\Controller\TestController::build'
    _title: 'Variable Parameter'
  requirements:
    _permission: 'access content'
    testparam: .+

It picks up the route with "/mymodule/hello", but not "/mymodule/hello/world".