如何在文件中访问 drawCustomMenuBlock()函数
Eternal \ CustomMenu \ Eternal \ CustomMenu \ Block \ Catalog \ Navigation.php,想要在页面app \ design \ frontend \ zonda \ default \ template \ page \ html \ header.phtml中访问这些功能。但是,如果我将这些代码放在文件
中
<?php echo $this->drawCustomMenuBlock() ?>
然后显示此错误:
Exception printing is disabled by default for security reasons.
我该如何解决这个问题? 请帮我解决这个问题。我是Magento的新人。
提前致谢。
答案 0 :(得分:0)
在phtml文件中,$ this表示该块的实例。
示例:page \ html \ header.phtml, $ this 是 app / code / core / Mage / Page / Block / Html / Header.php 的实例
所以在 app / code / core / Mage / Page / Block / Html / Header.php 中创建一个名为“ drawCustomMenuBlock ”的方法,然后从< strong>页\ HTML \ header.phtml 强>
试试吧。