SpartnerNL / Laravel-Sidebar

A Laravel Sidebar builder
MIT License
111 stars 58 forks source link

Incorrect spacing of @if and @endif in resources/views/item.blade.php causes Parse Error #28

Closed zedee closed 7 years ago

zedee commented 7 years ago

Hi, seems in that line 1 of item.blade.php :

<li class="@if($item->getItemClass()){{ $item->getItemClass() }}@endif @if($active)active@endif @if($item->hasItems())treeview@endif clearfix">

Causes the following error:

Parse error: syntax error, unexpected end of file, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF)

Putting an extra space before the start of @endif seems to solve the problem, so line 1 should be:

<li class="@if($item->getItemClass()){{ $item->getItemClass() }}@endif @if($active)active @endif @if($item->hasItems())treeview @endif clearfix">

Seems that the Blade's @foobar directives must be "isolated" with a space before.