我遇到了在表單元素的標籤中顯示html的問題。包含html字符的Magento字段標籤
下面是代碼:
question-$fieldset->addField($season->getId()."_".$question->getId(), 'checkboxes', array(
'name' => $season->getId()."_".$question->getId(),
'label' => $question->question,
'title' => $question->question,
'class' => 'season-questions '.$season->getId(),
'values' => $options,
'value' => ''
));
目前$>的問題有時會包含HTML字符,如
<p><strong>text</strong></p>
在瀏覽器中顯示時,這是剛剛呈現爲字符串。
如何讓html正確顯示?我曾嘗試:
getEscapedValue()
和
toHtml()
無濟於事。
是什麼'$ question-> question'? – 2014-08-28 17:39:34
它是字符串類型 – Panda4Man 2014-08-28 17:51:12