lundi 26 octobre 2015

In Laravel 5.1 blade templates, how can I use @yield without the extra space added at the end?

I have a blade template master.blade that has the following code:

<title>@yield('meta-title')</title>

And then in any views that extend this template, the data can be passed in like this:

@section('meta-title')My Meta Title @stop

However, this ALWAYS adds a space at the end. If I remove the space in the code so it looks like the following, then it will not recognise the @stop and the page breaks:

@section('meta-title')My Meta Title@stop

Is there a way to achieve this functionality (dynamically inject content into the header without any spacing before or after) either using @yield or some other way?

Blade Template Docs



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire