How to add a tag (span, small) to Laravel Form::label?

南笙酒味 提交于 2019-12-12 12:27:23

问题


In Laravel 4.1, I want to echo:

<label for="name">Name <small>required</small></label>

This doesn't work:

{{ Form::label('name','Name <small>required</small>') }}

are automatically converted to code text…

Is there a way or do I have to skip Form::label and do it manually?


回答1:


If you want to use a Html tag inside another by Laravel one you should use HTML::decode.

Correct code :

{{ HTML::decode(Form::label('name','Name <small>required</small>')) }}


来源:https://stackoverflow.com/questions/22259216/how-to-add-a-tag-span-small-to-laravel-formlabel

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!