Hi I realy like how magento creates it's view. It's not standart MVC like Codeigneter or Ruby on Rails. Magento has Block and Template. So I have created an architecture like this. I have layouts (xml files). And views(phtml files).
Layout example.
<data>
<register>
<referense to="master">
<action method="removeBlock" value="notice" />
</referense>
<referense to="master">
<action method="setTemplate" value="page/default.phtml" />
</referense>
<referense to="head">
<action method="addCss" value="css/form.css"></action>
</referense>
<referense to="master">
<block name="content" type="Customer/FormBlock" template="customer/form.phtml"></block>
</referense>
</register>
<activate>
<referense to="container">
<action method="setTemplate" value="customer/activate.phtml" />
</referense>
</activate>
</data>
The controller.
class CustomerController extends ActionController
{
public function indexAction()
{
//....
}
public function registerAction()
{
//....
}
public function activateAction()
{
//....
}
}
So when user calls "activate" action , it will render the view in <activate/> tag.
if there is no such tag , it will render for <default/> tag.
Is this pattern useful for small applications like Simple Blog ?. Because it's takes more time for development but the applications are very dynamic. May be there are more useful patterns like this one, if there are , please provide me. Thank you.