createCategory() 공개 메소드

Create a new category
public createCategory ( array $post ) : boolean
$post array
리턴 boolean
예제 #1
0
파일: Blog.php 프로젝트: paragonie/airship
 /**
  * Create a new category
  *
  * @route blog/category/new
  */
 public function newCategory()
 {
     if (!$this->can('create')) {
         \Airship\redirect($this->airship_cabin_prefix . '/blog/category');
     }
     $post = $this->post(new NewCategoryFilter());
     if (!empty($post)) {
         if ($this->blog->createCategory($post)) {
             \Airship\redirect($this->airship_cabin_prefix . '/blog/category');
         }
     }
     $this->lens('blog/category_new', ['active_link' => 'bridge-link-blog-category', 'categories' => $this->blog->getCategoryTree()]);
 }