magento xml

<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 />。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章