Пример #1
0
 public function createSolucionesAction()
 {
     $form = new Application_Form_RegistroSoluciones();
     if ($this->_request->isPost()) {
         if ($form->isValid($this->_request->getParams())) {
             $extn = pathinfo($form->imagen->getFileName(), PATHINFO_EXTENSION);
             $nameFile = 'imagen_soluciones_' . time('H:i:s') . '.' . $extn;
             $rutaFileAbs = $form->imagen->getDestination() . '/' . $nameFile;
             $form->imagen->addFilter('Rename', array('target' => $rutaFileAbs, 'overwrite' => true));
             if (!$form->imagen->receive()) {
                 echo 'se cago la imagen';
             }
             $value = $form->getValues();
             $soluciones = new Application_Entity_Soluciones();
             $arrayObject['_idCategoria'] = $value['categoria'];
             $arrayObject['_nombre'] = $value['nombre'];
             $arrayObject['_imagen'] = $nameFile;
             $arrayObject['_flagActivo'] = $value['flagActivo'];
             $arrayObject['_descripcionCorta'] = $value['descripcioCorta'];
             $arrayObject['_descripcion'] = $value['descripcioLarga'];
             $soluciones->setProperties($arrayObject);
             $soluciones->createSoluciones();
             $this->_redirect('/admin/Soluciones/');
             echo 'registrado';
         }
     }
     $this->view->form = $form;
 }