3

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

Isaque Palmieri
  • 97
  • 2
  • 2
  • 9

1 Answers1

1

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>
N69S
  • 16,110
  • 3
  • 22
  • 36