/** * 发表文章 */ public function pub() { $c = $this->post_uint('c'); $content = $this->post('content'); $title = $this->post('title'); if ($c && $title && $content) { $is = false; foreach (mcms::get_category() as $cat) { if (intval($cat['id']) === $c) { $is = true; break; } } if ($is === false) { return; } mcms::add_content($c, $title, $content); } view::assign('category', mcms::get_category()); }