Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/240.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何绕过toHtml()在Magento中打印html标记_Php_Html_Magento - Fatal编程技术网

Php 如何绕过toHtml()在Magento中打印html标记

Php 如何绕过toHtml()在Magento中打印html标记,php,html,magento,Php,Html,Magento,首先让我承认,我不是一个程序员,尽管我在这里和那里调整一些php方面有很多经验。 我也不太熟悉Magento的编码方式 我有一个客户,他想在面包屑中添加制造商的品牌名称,并在其中添加品牌名称链接。我们使用分层导航,这就是我获取链接的地方 我得到的输出是的Home/Categoryname/productname 在这里,由于breadcrumbs块与函数toHtml()相呼应,因此不会呈现html 我能绕过这个吗 这是我的代码:(代码放在产品的view.phtml中) //获取当前类别url $

首先让我承认,我不是一个程序员,尽管我在这里和那里调整一些php方面有很多经验。 我也不太熟悉Magento的编码方式

我有一个客户,他想在面包屑中添加制造商的品牌名称,并在其中添加品牌名称链接。我们使用分层导航,这就是我获取链接的地方

我得到的输出是的Home/Categoryname/productname 在这里,由于breadcrumbs块与函数toHtml()相呼应,因此不会呈现html

我能绕过这个吗

这是我的代码:(代码放在产品的view.phtml中)

//获取当前类别url
$current_category=Mage::registry('current_category')->getUrl();
//获取品牌名称
$brandname=Mage::getModel('catalog/product')->load($\u product->getId())->getAttributeText('manufacturer');
//html并将分层导航中的内容添加到其中
$brandurl=str_replace(“.html”、“/l/”.strtolower($brandname)。“.html”、$current_category);
$brandnamemurl=“of”;
//面包屑
$breadcrumbs=$this->getLayout()->getBlock('breadcrumbs');
$breadcrumbs->addCrumb('manufacturer',array('label'=>$brandnamemurl,'title'=>$brandname));
echo$this->getLayout()->getBlock('breadcrumbs')->toHtml();

html\u entity\u decode成功了

//I Added these two lines
$breadcrumbblock = $this->getLayout()->getBlock('breadcrumbs')->toHtml();  
echo html_entity_decode($breadcrumbblock);
//I Added these two lines
$breadcrumbblock = $this->getLayout()->getBlock('breadcrumbs')->toHtml();  
echo html_entity_decode($breadcrumbblock);