예제 #1
0
 public function newAction()
 {
     $form = new Admin_Form_Feed_New();
     if ($this->getRequest()->isPost()) {
         if ($form->isValid($_POST)) {
             $values = $form->getValues();
             try {
                 $id = Yadda_Model_Feed::create($values);
                 $this->getHelper('FlashMessenger')->addMessage('Feed created.');
                 $this->_redirect($this->getHelper('ReturnUrl')->getUrl('/feed/edit/id/' . $id));
             } catch (Yadda_Model_Exception $e) {
                 $this->view->flashMessages[] = 'Error: ' . $e->getMessage();
             }
         }
     } else {
         if (isset($_GET['site'])) {
             $form->populate(array('site' => $_GET['site']));
         }
     }
     $this->view->form = $form;
 }
예제 #2
0
파일: Edit.php 프로젝트: neilgarb/yadda
 public function __construct($feed)
 {
     parent::__construct();
     $this->setAction('/feed/edit/id/' . $feed['id']);
 }