【问题标题】:using button type="submit" instead of input - laravel使用按钮类型=“提交”而不是输入 - laravel
【发布时间】:2014-10-30 04:15:21
【问题描述】:

我需要在按钮标签上有很棒的字体图片。所以我不能使用<input type="submit">

<button type="submit" class="btn btn-success">
                <i class="fa-trash"></i> delete
</button>

在 laravel 上查看

{{ Form::open(array('method' 
=> 'DELETE', 'route' => array('admin.states.destroy', $value->id))) }}                       
                            {{ Form::submit(HTML::decode(FA::icon('trash')), array('class'
 => 'actions-line icon-trash','onclick'=>'return confirm("Are you sure?")')) }}
                        {{ Form::close() }}

这不是在按钮内呈现 html

正确的方法是什么?

【问题讨论】:

  • 第一个是Next 按钮,第二个是Delete 按钮!你需要什么?下一步或删除按钮?

标签: php laravel laravel-4 font-awesome blade


【解决方案1】:

类似

Form::button('<i class="fa fa-star"></i> Submit', array(
            'type' => 'submit',
            'class'=> 'actions-line icon-trash',
            'onclick'=>'return confirm("Are you sure?")'
    ));

根据您的口味量身定制。唯一需要注意的是类型设置为提交

【讨论】:

    猜你喜欢
    • 2017-11-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-04-10
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多