Ticket #45 (closed enhancement: fixed)
Support multiple instances of an engine
| Reported by: | boutell | Owned by: | boutell |
|---|---|---|---|
| Priority: | major | Milestone: | 1.0 |
| Component: | apostrophePlugin | Version: | Symfony 1.4 |
| Keywords: | Cc: | geoffd, dordille, rickybanister, agilbert, johnnybenson | |
| Symfony version: |
Description
This must:
* Allow you to have multiple instances of the same engine
* Make it possible to have distinct behavior for each instance
* Allow link_to and url_for calls on the current engine page to target that same engine page by default
* Allow explicit targeting of other engine page instances
* Allow explicit targeting of a specific engine page instance from a non-engine page.
Implementation notes:
* Document that route caching must be turned off and is almost always bad anyway (it's off by default in 1.3 and 1.4). Otherwise you'll get the wrong instance page a lot
* Distinct behavior isn't a problem - we can use the slug, or use the ID of the engine page as a foreign key in another table
* Make sure you look at getCurrentPage rather than getFirstEnginePage to determine what engine page instance a route should correspond to
* We can't fix url_for to support specifying an instance (note: it's worth double checking that there is truly no way to influence the context passed to the route). And we don't want to introduce a_url_for because doctrine route stuff wouldn't know about it. But we CAN push and pop the current engine:
aTools::pushEnginePage(slug)
Do whatever you want, it'll target slug rather than the current page or the first one found (when there is no current page)
aTools::popEnginePage()

