smartrahat
smartrahat

Reputation: 5649

Use <span> inside Form Label in Blade template

In html I can use <span> tag inside form label like this:

<label for="name" class="class-name">Name:<span class="required"></span></label>

Using Laravel Blade, the code for label is like this:

{!! Form::label('name','Name:',['class'=>'class-name']) !!}

How can I use <span> inside form label using blade template?

Upvotes: 8

Views: 6400

Answers (2)

Alex
Alex

Reputation: 35098

Just set the 4th parameter of Form::label to false which is escape_html = false.

{!! Form::label('name','Name: <span class="required"></span>', [], false) !!}

Upvotes: 8

J&#225;n Ambroz
J&#225;n Ambroz

Reputation: 168

Try this one code:

{!! Html::decode(Form::label('name','Name: <span class="required"></span>')) !!}

Upvotes: 9

Related Questions