How do I set HTML attribute with @yield () in Laravel?

0

I'm trying to create a template for my control panel in Laravel.

I want the top right corner to have a BACK button, where I can link to @yield

I tried to make the following code, but I was not successful, it shows as if href was blank

// layouts.master.blade.php
<a href="@yield('voltar')">Voltar</a>

and on the extended page

// usuario.editar.php
@extends('../layouts.master')

@section('voltar')
    dashboard
@stop
    
asked by anonymous 12.10.2014 / 18:45

1 answer

1

Assuming dashboard is the name of your route, you need to convert to a valid url before returning to href .

Try the following:

@extends('../layouts.master')

@section('voltar')
    link_to_route('dashboard')
@stop

More information on laravel documentation

    
13.10.2014 / 13:04