编辑显示为文本的图标

时间:2014-05-06 14:26:19

标签: laravel

我在laravel中创建一个应用程序。我创建了一个函数“helper.php”

public static function fa_link_to_action($action, $text, $icon = '', $params = array(), 

    $attrs = array()) {     
                if ($icon) {
                    $text = '<i class="fa fa-' . $icon . '"></i> ' . $text;
                }
                return link_to_action($action, $text, $params, $attrs);        

        }

我在视图中调用此功能

{{ Helpers\Helper::fa_link_to_action('CarController@edit','Edit','plus',null,$v->id)}}

问题在于它显示了这一点:<i class="fa fa-plus"></i> Edit 不是图标

1 个答案:

答案 0 :(得分:0)

尝试

return \HTML::decode(link_to_action($action, $text, $params, $attrs));