php - URL alias or replace with symfony2 -
i have application generates urls this
ex)
http://myserver.com/shows/12 http://myserver.com/shows/14 my routing.yml is
acme_top_writereviewschool: pattern: /show/{userid} defaults: { _controller: acmetopbundle:default:showuser} 12 or 14 id used in database.
id| name | position 12| james| pitcher 14| nick | short 15| ian | catcher now,what make alias urls
http://myserver.com/james http://myserver.com/nick or http://myserver.com/u=james http://myserver.com/u=nick or http://myserver.com/show/james http://myserver.com/show/nick i have googled keywords 'alias' 'url exchange' or something, howevere can't find example or bundle.
could me?
you can have multiple routes pointing same bundle:controller:action.
for example if want use http://myserver.com/james
acme_top_writereviewschool_by_name: pattern: /{name} defaults: { _controller: acmetopbundle:default:showuser} the thing have aware of in controller action need either pass request object either param "name" or "userid", alternatively name param same , manage hand (so speak).
could post controller action here also?
Comments
Post a Comment