<frontend_model> 指 Mage_P1_Block_P2
<frontend_model>adminhtml/system_config_form_field_notification</frontend_model>
实例化:Mage_Adminhtml_Block_System_Config_Form_Field_Notification
<frontend>
<routers>
<helloworld>
<use>standard</use>
<args>
<module>Alanstormdotcom_Configviewer</module>
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>网站前台的请求对应的控制器。
http://main.com/helloworld/index/index
如果URL中有<frontName>的值,就转发到<module>的控制器IndexController.php里的动作 indexAction()去处理。
实例化的类为:<module>_controllers_IndexController。
$obj = new Alanstormdotcom_Configviewer_IndexController;
$obj->indexAction();
布局文件
<reference name="footer_links">
<block type="blog/blog" name="add.blog.footer">
<block type="blog/tags" name="blog_tags" />
<action method="addFooterLink" ifconfig="blog/menu/footer"></action>
</block>
</reference>标签有一个“type”属性, P1 是 config.xml里的<blocks> 的项,P2 是类后缀
<blocks>
<blog>
<class>AW_Blog_Block</class>
</blog>
</blocks>
实例化:AW_Blog_Block_P2
config.xml中
<layout>
<updates>
<blog>
<file>aw_blog.xml</file>
</blog>
</updates>
</layout><updates />节点下面定义了所有将被装载的布局文件。
在模板文件的 layout文件下 。默认的在app/design/frontend/base/default/layout/下
布局文件
<blog_index_index>
<reference name="content">
<block type="blog/blog" name="blog" template="aw_blog/blog.phtml"/>
</reference>
</blog_index_index>
<blog_index_index> 代表一个控制器
<catalog_seo_sitemap_category translate="label">
<label>Catalog Seo Sitemap (Category List)</label>
<update handle="catalog_seo_sitemap" />
这段代码的意思是,如果一个请求包含了“catalog_seo_sitemap_category”操作,那么这个请求的布局文件也应该包含“catalog_seo_sitemap”操作标签下面的<block />和<reference />。
magento xml
最新推荐文章于 2019-08-06 02:51:44 发布