appstract / laravel-blade-directives

A collection of nice Laravel Blade directives
MIT License
860 stars 75 forks source link

leaving @if as @if #64

Closed jim1506 closed 4 years ago

jim1506 commented 4 years ago

Recently - since I did a composer update - I have a problem with one template that worked perfectly before.

The template commences with:

@if ( ($pg->noHeading != 1) and ($pg->headingStatic == 0) and ($pg->headingFullViewPort == 0) )
  <!-- default heading -->
    @include('front.include.in_heading_default')
@endif

@if ($pg->headingStatic == 1 )
   @include('front.include.in_heading_static')
@endif

but it is giving an error as the second @if is being ignored as can be seen from the php compiled blade template:

<?php if( ($pg->noHeading != 1) and ($pg->headingStatic == 0) and ($pg->headingFullViewPort == 0) ): ?> <!-- default heading --> <?php echo $__env->make('front.include.in_heading_default', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php endif; ?>@if ($pg->headingStatic == 1 ) <?php echo $__env->make('front.include.in_heading_static', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php endif; ?>@if ($pg->headingFullViewPort == 1) <?php echo $__env->make('front.include.in_heading_full', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php endif; ?>@if ($pg->js_beforetext <> "") <br/> <?php echo $pg->js_beforetext; ?><?php endif; ?>@if ($pg->noHeading == 1) {$margin = "6em";}<?php else: ?> {$margin = "1em";}<?php endif; ?>@if ($pg->noHeading == 1) <?php echo $__env->make('front.adverts.topAd', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php endif; ?>@if (alltrim($pg->beforePageText) <> '') <div class="container"> <div class="row"> <div class="col-12" style="margin-top:1em"> <?php echo $pg->beforePageText; ?> </div> </div> </div><?php endif; ?>@if (!$pg->noHeading == 1) <div class="container" id="PT"> <div class="row"> <div class="col-12 <?php echo e($pg->getColumns->class); ?>" style="margin-top:<?php echo e($margin); ?>;"> <?php echo $pg->pageText; ?> </div> </div> </div><?php endif; ?><?php /**PATH /home/tdbhosti/tdbsurvey.com/resources/views/front/include/in_header.blade.php ENDPATH**/ ?>

gizburdt commented 4 years ago

This is a problem with default Blade, not an issue for this package. Please check Laravel docs or forums.