mercredi 2 juillet 2014

laravel how to use a blade code inside the { }


Vote count:

0




This is my code



<a href="{{ URL::to('restaurants/20/edit') }}" class="{{$verticalMenuTab =='Edit' && $verticalMenu == 'Restaurant' ? 'selectedTab' :''}}">
<i class="fa fa-edit"></i>
Edit Information
</a>


Instead of the 20 I want to use : `Auth::user()->restaurant_id


I tried to do this:



<a href="{{ URL::to('restaurants/$Auth::user()->restaurant_id /edit') }}" class="{{$verticalMenuTab =='Edit' && $verticalMenu == 'Restaurant' ? 'selectedTab' :''}}">
<i class="fa fa-edit"></i>
Edit Information
</a>


but I got the string as it is not the value of it.


could you help me please?


`



asked 35 secs ago






Aucun commentaire:

Enregistrer un commentaire