2013-07-09 203 views
0

我試圖使用從動作助手這樣:我可以使用操作助手嗎?

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"'); 

但我得到這個錯誤:

Fatal error: Call to undefined function _parse_attributes() in /var/www/html/monitor/lib/vendor/symfony/lib/helper/AssetHelper.php on line 333

爲什麼?

+0

@MichalTrojanowski不錯,這是我該離開我的答覆,其他用戶說,我移動到一個乾淨的解決方案 – Reynier

回答

4

_parse_attributes()函數位於標籤助手中。

所以你將不得不進口標籤助手以及

sfContext::getInstance()->getConfiguration()->loadHelpers(array('I18N', 'Asset', 'Url', 'Tag')); 
+0

是的,我找到了發表類似於我的問題,但也表示,從動作/控制器使用助手是不正確的,並打破完成MVC,所以我繼續前進一個更乾淨的解決方案,無論如何謝謝 – Reynier

相關問題