hi bruno,
1)
a cmf route allows you to store the "variablePattern" which would mean
you can place that route at /cms/routes/2013_budget with a variable
pattern {id}/{action} and requiements and defaults on id and action. the
only drawback would be that all actions would go to the same controller
action.
you could then use a custom route enhancer to change the controller
based on whether the id is present and based on the action. see
http://symfony.com/doc/current/cmf/components/routing/dynamic.html#route-enhancers
2)
another option could be to have your code generate a
/cms/routes/2013_budget route, and then one at
/cms/routes/2013_budget/add and use RoutingAutoBundle to generate an
explicit route object for each item.
3)
with the phpcr-odm, you can't have more than one route with the same
non-variable path, so having rest-ful routes for adding, editing and
deleting would not work. (eg. having 3 routes at
/cms/routes/2013_budget/234 , one for POST, one for PUT, one for DELETE).
with the orm you have more flexibility in this case as it would allow
this. or also prefix: /cms/routes/2013_buget , variable: /{id}/add and
another one with /{id}/edit
4)
yet another option could be to have your own route provider that checks
if such a app route is in the candidate collection, and adds the needed
routes to the collection. see
http://symfony.com/doc/current/cmf/components/routing/nested_matcher.html
i hope this helps. imho 1 and 4 are your best options for this scenario.
you will have to dig through the cmf routing process but it should be
able to solve your situation rather elegantly.
david
On 05.03.2015 22:58, Bruno Reis wrote:
> Hi,
>
> I'm creating a content type that is, in fact, an app module. Or an app
> module container. I want the user to be able to insert it under any
> place he wants in the site. And I want to create routes relative to that
> "basepath". Let's say I have
>
>
www.mysite.com <
http://www.mysite.com>
>
> then I create a /2013_budget content, so I can access it using:
>
>
www.mysite.com/2013_budget <
http://www.mysite.com/2013_budget>
> <
http://www.mysite.com/2013_budget/234/add>
>
> Is it possible? Probably yes. But, what is a good way to achieve it?
>
> --
> You received this message because you are subscribed to the Google
> Groups "symfony-cmf-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
symfony-cmf-us...@googlegroups.com
> <mailto:
symfony-cmf-us...@googlegroups.com>.
> For more options, visit
https://groups.google.com/d/optout.
--
Liip AG // Agile Web Development // T
+41 43 500 39 80
CH-8005 Zurich // PGP 0xA581808B //
www.liip.ch