I'm trying to build an Symfony2 application, that have CMS features.
I've got three entities (among others) which are : Page
, Category
, Post
(classic ones, huh ?)
I would like to have the following routing :
Page : /{slug} (slug is a Page entity field)
Category : /{slug} (slug is a Category entity field)
Post : /{slug} (slug is a Post entity field)
However, this will never work, because Symfony2 router, will match the first route that corresponds to the /{slug}
pattern.
I would like to know, what is the best pratice to handle these cases. I'm aware of Symfony CMF, but I do not want use this kind of massive tool (as it contains too many bundles which I'm not willing to use).
Thanks in advance for your answers