我不知道为什么我的块没有显示出来。它没有显示在任何页面上,我清除了缓存。有人能帮我弄清楚我错过了什么吗?但是,var_dump('test')
显示!为什么我的块没有显示?
应用程序/设计/前端/预设/默认/模板/贾斯汀/ head.phtml
testing this block
贾斯汀/比伯/座/ Sings.php
class Justin_Bieber_Block_Sings extends Mage_Core_Block_Template
{
protected function _construct()
{
parent::_construct();
var_dump("test");
}
}
config.xml中
<frontend>
...
<layout>
<updates>
<bieber>
<file>justin.xml</file>
</bieber>
</updates>
</layout>
</frontend>
<global>
<blocks>
<bieber>
<class>Justin_Bieber_Block</class>
</bieber>
</blocks>
...
</global>
app/design/frontend/default/default/layout/justin.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<default>
<reference name="head">
<block type="bieber/bieber" name="justin_bieber">
<action method="setTemplate">
<template>justin/head.phtml</template>
</action>
</block>
</reference>
</default>
</layout>
我同意@blakcaps。模块类型“bieber/bieber”是错误的 – 2012-07-29 09:15:20
我改变了它,但它仍然不起作用。我可能会做错什么? – Strawberry 2012-07-30 00:47:42