Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Documented the trailing_slash_on_root option #9490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

javiereguiluz
Copy link
Member

This fixes #9484.

@nicolas-grekas could you please verify if the config of the example is correct? I don't know if trailing_slash_on_root is defined for annotations. Thanks!

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;

/**
* @Route("/site", "trailing_slash_on_root"="false")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this does not work on annotations: trailing_slash_on_root works only as an import option.

use Symfony\Component\Routing\RouteCollection;

$app = $loader->import('../src/Controller/', 'annotation');
// the second argument is the $trailing_slash_on_root option
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the argument is named $trailingSlashOnRoot in PHP, for what it matters :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Routing] allow no-slash root on imported routes
3 participants