Friday, March 31, 2017

How to display a text inside a tag if a value passed from controller is true using blade template?

I want to disable input if the value transferred from the controller is false. I read the blade template documentation for Laravel, but couldn't find any useful resource.

I tried the following code, but it yields an error.

<input type="text" name="url" style="height:36px;"   value="http://theurl.in/" @if $isEditable enabled @endif /> <br/>

The exact code part is,

@if $isEditable enabled @endif

enter image description here

If you can provide any suggestion, it would be very helpful.

Thanks!



via Isuru

Advertisement