Send variable to layout in laravel4 with blade

-1

I'm having a problem here, I need to send a variable to my layout, so I tried:

No controller

$this->layout->page = 'Atendentes';

and in the layout this

@yield('page')

The problem is that I need to compare this page variable within an if in case it is:

@if ( @yield('page') == 'Atendentes' )
    //do something
@endif

<?php if ( <?php echo $__env->yieldContent('page') == 'Atendentes' ); ?>: ?>
    
asked by anonymous 11.04.2014 / 20:04

1 answer

1

I was able to use the view :: share in the controller to share a variable in all my views

   $page = 'Atendentes';
   View::share('page', $page);
    
11.04.2014 / 21:20