public function vistaListado()
 {
     $marcas_principales = Marca::where('tipo', 'P')->where('estado', 'A')->get();
     $marcas_secundarias = Marca::where('tipo', 'S')->where('estado', 'A')->get();
     $this->array_view['marcas_principales'] = $marcas_principales;
     $this->array_view['marcas_secundarias'] = $marcas_secundarias;
     //Hace que se muestre el html lista.blade.php de la carpeta item
     //con los parametros pasados por el array
     return View::make($this->folder_name . '.lista', $this->array_view);
 }
 public function mostrarInfoMenuPorMarca($url, $marca)
 {
     $menu = Menu::where('url', $url)->where('estado', 'A')->first();
     if ($menu) {
         $this->array_view['menu'] = $menu;
         if (!is_null($menu->categoria())) {
             $marcas = array();
             foreach ($menu->secciones as $seccion) {
                 if (count($seccion->items) > 0) {
                     foreach ($seccion->items as $item) {
                         if (!is_null($item->producto())) {
                             if (!is_null($item->producto()->marca_principal())) {
                                 array_push($marcas, $item->producto()->marca_principal()->id);
                             }
                         }
                     }
                 }
             }
             $marcas_principales = Marca::where('tipo', 'P')->whereIn('id', $marcas)->where('estado', 'A')->orderBy('nombre')->get();
             $this->array_view['marcas_principales'] = $marcas_principales;
             $this->array_view['marca_id'] = $marca;
             $this->array_view['ancla'] = Session::get('ancla');
             return View::make($this->folder_name . '.menu-contenedor', $this->array_view);
         } else {
             return View::make($this->folder_name . '.' . $this->project_name . '-ver-menu-estatico', $this->array_view);
         }
     } else {
         $this->array_view['texto'] = Lang::get('controllers.error_carga_pagina');
         //return View::make($this->project_name . '-error', $this->array_view);
         return Redirect::to('/');
     }
 }
 public function vistaDestacar($id, $next)
 {
     //Me quedo con el item, buscando por id
     $producto = Producto::find($id);
     if ($producto) {
         $marcas_principales = Marca::where('tipo', 'P')->where('estado', 'A')->get();
         $marcas_secundarias = Marca::where('tipo', 'S')->where('estado', 'A')->get();
         $this->array_view['marcas_principales'] = $marcas_principales;
         $this->array_view['marcas_secundarias'] = $marcas_secundarias;
         $this->array_view['item'] = $producto->item();
         $this->array_view['producto'] = $producto;
         $this->array_view['continue'] = $next;
         return View::make($this->folder_name . '.destacar', $this->array_view);
     } else {
         $this->array_view['texto'] = Lang::get('controllers.error_carga_pagina');
         //return View::make($this->project_name . '-error', $this->array_view);
         return Redirect::to('/');
     }
 }