FIX: los segmentos no eran cargados de forma global
This commit is contained in:
@ -52,6 +52,14 @@ return [
|
||||
$file = json_decode(trim(file_get_contents($filename)));
|
||||
return $file->visits;
|
||||
},
|
||||
'segmentos' => function(Container $c) {
|
||||
$filename = implode(DIRECTORY_SEPARATOR, [
|
||||
$c->get('folders.data'),
|
||||
'segmentos.json'
|
||||
]);
|
||||
$segmentos = json_decode(trim(file_get_contents($filename)));
|
||||
return $segmentos;
|
||||
},
|
||||
Slim\Views\Blade::class => function(Container $c) {
|
||||
return new Slim\Views\Blade(
|
||||
$c->get('folders.templates'),
|
||||
@ -64,7 +72,10 @@ return [
|
||||
'header' => (object) [
|
||||
'fecha' => ucwords(Carbon::today()->locale('es')->isoFormat('D MMMM YYYY')),
|
||||
'hora' => Carbon::now()->format('H:i a'),
|
||||
'uf' => $c->get('ProVM\KI\Common\Service\Indicadores')->get('uf', Carbon::today())->valor
|
||||
'uf' => $c->get('ProVM\KI\Common\Service\Indicadores')->get('uf', Carbon::today())->valor,
|
||||
'menu' => (object) [
|
||||
'segmentos' => $c->get('segmentos')
|
||||
]
|
||||
],
|
||||
'footer' => (object) [
|
||||
'visitas' => $c->get('visitas')
|
||||
|
@ -12,7 +12,7 @@
|
||||
<div class="ui simple dropdown item" id="productos_menu">
|
||||
<a href="{{$urls->base}}/productos">PRODUCTOS</a>
|
||||
<div class="menu">
|
||||
@foreach ($segmentos as $segmento)
|
||||
@foreach ($header->menu->segmentos as $segmento)
|
||||
<a class="item" href="{{$urls->base}}/productos#{{mb_strtolower($segmento->titulo)}}">{{$segmento->titulo}}</a>
|
||||
@endforeach
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user