コード例 #1
0
 public function createAction()
 {
     $form = new Post_Form();
     $form->removeElement('content');
     $form->removeElement('teaser');
     if ($form->isValid($_POST)) {
         $values = $form->getValues();
         $mdlPost = new Blog_Post();
         $post = $mdlPost->createPost($values['blog_id'], $values['title']);
         $this->_request->setParam('id', $post->id);
         $this->_forward('edit');
     } else {
         $blogId = $_POST['blog_id'];
         if ($blogId > 0) {
             $this->_request->setParam('id', $blogId);
             $this->_forward('edit', 'blog');
         } else {
             $this->_forward('index', 'index');
         }
     }
 }