symfony-cmf / routing-auto-bundle

Adding automatic route generating on top of the symfony cmf routing
https://cmf.symfony.com
14 stars 29 forks source link

SF parameters recognition #137

Closed petforsberg closed 9 years ago

petforsberg commented 10 years ago

Just installed all (except Tree Browser) bundles to dev-master version. Hoped it will work with newest Routing Auto, but it doesn't...

From my config:

uri_schema: /{category}/%relative_articles_path%/{title}

URL generated is:

..../category/%relative_articles_path%/title

not

..../category/articles/title

Route Auto bundle doesn't recognize SF global parameters. Hope that paths duplication is not aimed. :)

dantleech commented 10 years ago

I think this should be supported through a provider. e.g.

schema: /{category}/{relative_article_path}/{title}
token_providers:
     relative_article_path: [ symfony_container, [ param: relative_article_path ] ]
dantleech commented 10 years ago

Created a PR: https://github.com/symfony-cmf/RoutingAuto/pull/17

dantleech commented 10 years ago

I have created a provider which uses the Symfony Expression Language, which would neatly solve this problem: https://github.com/symfony-cmf/RoutingAuto/pull/18

wouterj commented 9 years ago

Closing as the token provider was added by https://github.com/symfony-cmf/RoutingAutoBundle/pull/153