【问题标题】:Layout not rendering in layout.xml布局未在 layout.xml 中呈现
【发布时间】:2023-04-06 13:05:01
【问题描述】:

我创建了一个自定义模块并在 config.xml 中调用了我的 layout.xml 文件

这是我的 layout.xml 文件的代码

<?xml version="1.0"?>   
<layout version="0.1.0">   
  <cartpdf_index_index>   
    <reference name="root">   
      <action method="setTemplate"><template>page/1column.phtml</template></action>   
    </reference>   
    <reference name="content">   
      <block type="cartpdf/index" name="cartpdf_index" template="cartpdf/index.phtml"/>   
    </reference>   
  </cartpdf_index_index>  
</layout>  

当我使用die() 检查cartpdf 索引控制器时,它可以工作,即使它设置页面的布局 1column, 2columns-left 无论你设置什么。但它不会在内容区域调用 phtml 文件。

我在本地系统中的新 Magento 中检查了这个模块,它在那里工作正常,但在服务器中没有。

这可能是什么问题?

【问题讨论】:

  • 检查你是否有正确的块类型,通过在演示文件中实例化它
  • Test_Cartpdf_Block 它在我创建它的地方和我的本地系统中工作。但不在不同的客户端服务器中
  • 如果您的本地和客户端平台不同,请重新检查文件夹的大小写,这可能会导致问题。

标签: php xml magento


【解决方案1】:

这是编译模式的问题。我禁用了它,现在它工作正常。

【讨论】:

    猜你喜欢
    • 2021-10-26
    • 1970-01-01
    • 1970-01-01
    • 2015-10-14
    • 2016-11-16
    • 1970-01-01
    • 1970-01-01
    • 2017-07-07
    • 1970-01-01
    相关资源
    最近更新 更多