read blade variable within the route function

Isaque Palmieri :

I have a system in Laravel and when I am in the view I build the template with links, I need to insert a route dynamically like this:

<ul class="breadcrumbs pull-left">
    <li><a href="{{route('home')}}">Home</a></li>
    <li><a href="{{route('$route.index')}}">{{$title}}</a></li>
    <li><span>{{$activeList}}</span></li>
</ul>

how to read blade variable within the route function?

this dont work:

{{route('$route.index')}}

error: "Route [$active.index] not defined. (View: C:\xampp\htdocs\systemass\resources\views\templates\srtdash\inc\pagearea.blade.php) (View: C:\xampp\htdocs\systemass\resources\views\templates\srtdash\inc\pagearea.blade.php) (View: C:\xampp\htdocs\systemass\resources\views\templates\srtdash\inc\pagearea.blade.php

N69S :

just use the variable content instead

<ul class="breadcrumbs pull-left">
    <li><a href="{{route('home')}}">Home</a></li>
    <li><a href="{{route($active.'.index')}}">{{$title}}</a></li>
    <li><span>{{$activeList}}</span></li>
</ul>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=9769&siteId=1