Example #1
0
 public function editAction()
 {
     if ($this->_id === null) {
         $params = $this->getRequest()->getParams();
         if (is_array($params) && count($params) > 0) {
             $keys = array_keys($params);
             $this->_id = $params[$keys[0]];
         }
     }
     if ($this->_id) {
         $this->_sc->setCurrentId($this->_id);
         if ($this->getRequest()->isPost()) {
             if ($this->_post == null) {
                 $this->_post = $this->getRequest()->getPost();
             } else {
                 $this->_post = array_merge($this->getRequest()->getPost(), $this->_post);
             }
             $this->_sc->saveForm($this->_post);
         }
         return;
     }
 }