condition does not work on blade laravel 5.2 -


i want load panel if user logged in

and if client master

but both files loaded @ runtime.

it not run bet!

@if(auth::check())     @extends('panel') @else     @extends('master') @endif 

what want? have different layouts logged user , not logged one?

@extends(auth::check() ? 'panel' : 'master')

you can't use 2 extends.

two extends generate compiled views code

<?php if(auth::check()): ?>  <?php else: ?>  <?php endif; ?> 

you can see, extends not here. in end of -

<?php echo $__env->make('panel')... ->render(); <?php echo $__env->make('master')... ->render(); 

that's why use see them both.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -