Layout 内容显示两次
我刚刚创建了一个模块,并将其放在布局文件中:Layout 内容显示两次,layout,module,block,magento-1.9.1,Layout,Module,Block,Magento 1.9.1,我刚刚创建了一个模块,并将其放在布局文件中: <?xml version="1.0"?> <layout version="0.1.0"> <filteredproducts_index_index> <reference name="root"> <action method="setTemplate"> <template>page/2col
<?xml version="1.0"?>
<layout version="0.1.0">
<filteredproducts_index_index>
<reference name="root">
<action method="setTemplate">
<template>page/2columns-left.phtml</template>
</action>
</reference>
<reference name="content">
<block type="filteredproducts/myblock" name="myblock" template="test.phtml"/>
</reference>
</filteredproducts_index_index>
</layout>
第页/2列-left.phtml
现在由于某种原因,不知道我在reference name=“content”标记中放了什么块。该块显示两次
test.phtml:
<?php
echo "test";
?>
页面上显示的文本是testtest。
因此,由于某种原因,内容必须加载两次,我似乎不知道如何加载。
感谢您的帮助。可能与您使用“echo”的方式有关,但我恐怕无法提供提示。不,这不是真正的问题。谢谢你的回答。