public function execute() { $config = $this->getConfig(); $rol = new rolTable($config); $this->objRol = $rol->getAll(); // así declaramos la vista a usar $this->defineView('rol', 'index', 'html'); }
public function execute() { $id = filter_input(INPUT_GET, 'id'); $config = $this->getConfig(); $rol = new rolTable($config); $this->objRol = $rol->getById($id); $this->defineView('rol', 'ver', 'html'); }
public function execute() { $config = $this->getConfig(); $formRol = filter_input_array(INPUT_POST)['rol']; $rol = new rolTable($config); $rol->setNombre($formRol['nombre']); $this->objRol = $rol->save(); header('Location: ' . $config->getUrl() . 'index.php/rol/index'); }
public function execute() { $config = $this->getConfig(); $formRol = filter_input_array(INPUT_POST)['rol']; //validaciones $rol = new rolTable($config); $rol->setId($formRol['id']); $rol->setNombre($formRol['descripcion']); $this->objRol = $rol->update(); header('Location: ' . $config->getUrl() . 'index.php/rol/index'); }