Support the ongoing development of Laravel.io →
posted 10 years ago
Views Blade
Last updated 2 years ago.
0

I know this issue too. Try not to intend your section content and remove white-space at line endings.

@section('div-id')
test_id
@stop

@section('content')
@lang('texts.test')
@stop
Last updated 2 years ago.
0

Thank you for you quick answer, it works for the first white-space (not always though), but not for the second. I checked and I have no white-spaces or tabs at the end of my lines. If I remove the CR LF, it's not working at all (it appears there need to be a line break before the @stop command).

Result with your input is:

<div id="test_id ">
  <p> test </p>
</div>

I don't know why it doesn't fix the first white-space of the 'content' section tho.

Last updated 2 years ago.
0

Another solution: totally forgot about this ^^

@section('title', 'value')

Result

<title>value</title>

Example: http://alexwenzel.de/2014/223/line-breaks-in-blade-sections-and-yields

Last updated 2 years ago.
0

Ow, that's great to know, thank you!

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

SynRJ synrj Joined 3 Sep 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.