我一直在玩magento的PHP文件。 但是,我似乎无法弄清楚会被拉出来的东西
<?php echo $this->getChildHtml('content') ?>
以及来自何处。例如,我可以
看到一些文字说“主页”,但我不能
通过趟过来找到它的来源
/app/design/frontend/base/default
下的各种文件
并打开模板路径提示无济于事。
我正在运行的magento版本是1.7.0.2。 任何帮助将不胜感激。
答案 0 :(得分:4)
内容块是用于包装页面内容的所有块的结构块。 getChildHtml('content')加载通过
添加到布局“content”中的所有块1. xml via <reference name="content"><block type="core/template') name="test" template="test.phtml"/>
2. code via $this->getLayout()->getBlock('content')->append($block);
调用'content'中每个块的toHtml方法返回其html