Hello, Qiang and Wei.
I've decided to port my Prado project to YII for many reasons. After investigating Yii for last 2 days I've stuck with porting my project to YII methodology. Probably, I misunderstand it's concept.
In my Prado project I had strict separation of presentation layer and functional layer. This is how it worked. In WebRoot/WebSites/*/ directories I has master templates, pages, skins and assets. Master template and pages were embedding portlets which, in turn, were functional controls based on TTemplateControl. With this sheme I was able to place multiple portlets on a single page and all of them were working independently. For example,
Master Layout: <com:TWebsitePollPortlet />
Contacts Page: <com:TSendMessagePortlet />
Both portlets have buttons and both portlets react to clicks on those buttons by showing operation status message (e.g. 'Your message was sent') in their matching place.
In Yii we still have logic/presentation separated but the concept is totally different. For example, if I want to implement 'SendMessageController' I will probably inherit it from something like 'XPortlet'. This controller will perfectly process it's actionSendMessage() and here is the question: how will YII know what page user was at before performing this action's POST?
Controller is always leading to a single view but I need views hierarchy:
Layout - Page (no code behind) - Portlet1, Portlet2 (functional code).
Is this implemented in YII? What is the best practice to implement this sheme?
Another question is how do I implement something like I had in Prado for accumulative configuration? For example:
application.xml + config.xml + config.xml + … = runtime config
This is primarily needed to configure pages permissions like it was in Prado,
<authorization> section.
Thanks for your great work.