我可以从行动中使用帮手吗?

时间:2013-07-09 15:17:23

标签: symfony1 symfony-1.4

我正试图以这种方式使用行动中的助手:

sfContext::getInstance()->getConfiguration()->loadHelpers(array('I18N', 'Asset', 'Url'));
echo image_tag('bullet_red.png');
echo link_to('Ver detalles', 'ver-detalles/' . $record->getIdregistros(), 'class="btn btn-success btn-mini"');

但是我收到了这个错误:

  

致命错误:调用未定义的函数_parse_attributes()   /var/www/html/monitor/lib/vendor/symfony/lib/helper/AssetHelper.php on   第333行

为什么?

1 个答案:

答案 0 :(得分:4)

_parse_attributes()函数位于Tag Helper中。

因此您还必须导入Tag Helper

sfContext::getInstance()->getConfiguration()->loadHelpers(array('I18N', 'Asset', 'Url', 'Tag'));
相关问题