zoukankan      html  css  js  c++  java
  • Magento布局文件中的标签以及标签属性

    一:<reference>标签表示替换一个已经存在的块。例如:

    <block type="page/html" name="root" output="toHtml" template="page/2columns-left.phtml">

      <!-- ... sub blocks ... -->

    </block>
    <reference name="root">
      <block type="page/someothertype" name="root" template="path/to/some/other/template" />

        <!-- ... sub blocks ... -->

       </block>
    </reference>

    (注:Magento 首先会创建一个name为root的块,然后他发现有一个name也是root的reference标签,Magento就会把原来的那个root替换为 reference标签里的那个块。)

    二:布局的handel标签  <模块名_控制器名_方法名>

    1:default标签

    表明这个layout布局将对多有的请求都有效。

    2:<模块名_控制器名_方法名>

    表明这个layout布局仅仅对对应的url请求有效

      <customer_account_index>
        <!-- ... -->
          <update handle="customer_account"/>
            <!-- ... -->
      </customer_account_index>

    三:update 标签

      <customer_account_index>
        <!-- ... -->
          <update handle="customer_account"/>
            <!-- ... -->
      </customer_account_index>
    customer模块account控制器index方法的请求
    这段代码的意思是,如果一个请求包含了“customer_acount_index”操作,那么这个请求的布
    局文件也应该包含“customer_account”操作标签下面的<block />和<reference />。

    四:block标签及其属性

    1:output属性

    任何一个拥有output属性的块都是顶层块,在拥有多个顶层块的情况下Magento将按照块定义的先后顺序输出HTML

    2:name属性

    3:as属性

    4:type属性

    5:template属性

    6:translate属性

    7:module属性

  • 相关阅读:
    SQL Server中字段类型对应的C#中的数据类型
    ADO.NET复习总结(4)--访问SqlServer的类
    ADO.NET复习总结(3)--参数化SQL语句--防止sql注入式攻击
    关于MAX()函数的一点思考
    MySQL in or效率对比
    php trim源码分析
    MySQL MVCC机制
    一致性hash
    MySQL锁总结
    网关 php-cgi fastcgi phpfpm
  • 原文地址:https://www.cnblogs.com/magento/p/3461128.html
Copyright © 2011-2022 走看看