Example #1
0
File: Crud.php Project: nabble/ajde
 public function process()
 {
     switch ($this->_attributeParse()) {
         case 'list':
             $options = issetor($this->attributes['options'], []);
             $crud = new Ajde_Crud($this->attributes['model'], $options);
             $crud->setAction('list');
             return $crud;
             break;
         case 'edit':
             $options = issetor($this->attributes['options'], []);
             $id = issetor($this->attributes['id'], null);
             $crud = new Ajde_Crud($this->attributes['model'], $options);
             $crud->setId($id);
             $crud->setAction('edit/layout');
             return $crud;
             break;
         case 'mainfilter':
             $controller = Ajde_Controller::fromRoute(new Ajde_Core_Route('_core/crud:mainfilter'));
             $controller->setCrudInstance($this->attributes['crud']);
             $controller->setRefresh(issetor($this->attributes['refresh'], false));
             return $controller->invoke();
     }
     // TODO:
     throw new Ajde_Component_Exception();
 }
Example #2
0
 public function process()
 {
     switch ($this->_attributeParse()) {
         case 'list':
             $options = issetor($this->attributes['options'], array());
             $crud = new Ajde_Crud($this->attributes['model'], $options);
             $crud->setAction('list');
             return $crud;
             break;
         case 'edit':
             $options = issetor($this->attributes['options'], array());
             $id = issetor($this->attributes['id'], null);
             $crud = new Ajde_Crud($this->attributes['model'], $options);
             $crud->setId($id);
             $crud->setAction('edit');
             return $crud;
             break;
     }
     // TODO:
     throw new Ajde_Component_Exception();
 }
Example #3
0
 protected function _getCustomTemplateAction($action)
 {
     return 'crud/' . (string) $this->_crud->getModel()->getTable() . '/' . $action;
 }