symfony - How to set default route parameter from session? -


if have batch of routes looking this:

/{location}/catalog /{location}/search 

etc.

session has "location" attribute (alias auto-recognized user location, e.g. city). so, generate each route {location} parameter, need do

{ location: session.get('location') } 

is there way automatically? can override default urlgenerator , inject @session it?

try override routingextension class /vendor/symfony/symfony/src/symfony/bridge/twig/extension/codeextension.php symfony 2.1 extending core classes

also fork https://github.com/symfony/twigbridge , use composer http://getcomposer.org/doc/05-repositories.md#vcs


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -