示例#1
0
 /**
  * Редактировать пост:
  */
 public function postEditAction(Application $application, Template $template)
 {
     if ($_SERVER['REQUEST_METHOD'] == 'GET') {
         $template->setParameter('menu', 'posts');
         $this['post'] = Blog_BlogPostsModel::GetPost($_GET['id']);
         return true;
     } else {
         Blog_BlogPostsModel::EditPost($_POST['id'], $_POST, false);
         $template->headerSeeOther('http://' . TemplateHelper::getSiteUrl() . '/admin/postEdit?id=' . $_POST['id']);
         exit;
     }
 }