[Solar-talk] Nested controllers
Travis Swicegood
development at domain51.com
Thu Oct 19 07:44:19 PDT 2006
Paul M Jones wrote:
> On Oct 19, 2006, at 9:11 AM, Travis Swicegood wrote:
>
>
>> Hi Rodrigo,
>>
>> Rodrigo Moraes wrote:
>>
>>> Ok, back to this subject. :)
>>>
>>> Does this idea evolved? It seems that putting PageType in the first
>>> level is unnecessary. With nested (or "forwarding") controllers, the
>>> last controller in the chain shouldn't be allowed to tell which
>>> display should be rendered? How about this:
>>>
>>> index.php/Controller/Action/PageType
>>>
>>>
>> Actually, no you wouldn't want it to execute that way. Let me put the
>> URI in a more understandable format:
>>
>> index.php/PageType/Controller/Action
>> is
>> index.php/HTML/Bookmarks/List
>>
>> So, the idea is that Bookmarks/List here generates a the actual
>> content
>> while HTML, acting as the parent controller, wraps the content. The
>> same could be done with:
>>
>> index.php/RSS/Bookmarks/List
>> index.php/PDF/Bookmarks/List
>> index.php/Bookmarks/List
>>
>> The last example without a pagetype would render just the raw
>> Bookmarks/List.
>>
>
> I agree with Rodrigo's earlier comment that having the page-type
> first seems ... inelegant.
>
> Besides page-types (html/rss/pdf/etc) and site layouts, what would
> this be used for? I can think of other ways to respond to page-type
> requests that are more transparent, and for layouts we can put all
> the in the layout scripts.
>
The big thing this is used for is to provide a means in the URL of
pulling out the display elements and rendering one controller/action
output - for AJAX calls.
Granted, it could be done with a ?out=ajax at the end, but that's less
elegant that submitting to bookmark/edit instead of site/bookmark/edit.
-Travis
More information about the solar-talk
mailing list