HelperList 列中的原始 HTML
Raw HTML in HelperList column
我在 Prestashop (1.6) 中有一个 HelperList
,还有几个 columns/rows。其中一列是锚元素 (a href
),我需要像列表中那样显示它,但 Prestashop 转义了该值并将其表示为文字字符串。
如何在 HelperList
的其中一列中显示实际锚点元素?
另外:我希望不必覆盖 PS 类,也不必为了更改一行代码而复制整个模板。我确实知道如何使用这些方法中的任何一种来做到这一点,但我正在寻找更少的东西 "aggressive"。
你可以使用这个技巧:
$fields_list = array(
'your_link' => array(
'title' => $this->l('Your title'),
'type' => 'bool',
'float' => true, // a trick - prevents from html escaping
// else code
),
);
我在 Prestashop (1.6) 中有一个 HelperList
,还有几个 columns/rows。其中一列是锚元素 (a href
),我需要像列表中那样显示它,但 Prestashop 转义了该值并将其表示为文字字符串。
如何在 HelperList
的其中一列中显示实际锚点元素?
另外:我希望不必覆盖 PS 类,也不必为了更改一行代码而复制整个模板。我确实知道如何使用这些方法中的任何一种来做到这一点,但我正在寻找更少的东西 "aggressive"。
你可以使用这个技巧:
$fields_list = array(
'your_link' => array(
'title' => $this->l('Your title'),
'type' => 'bool',
'float' => true, // a trick - prevents from html escaping
// else code
),
);