createCategory() public method

Create a new category
public createCategory ( array $post ) : boolean
$post array
return boolean
Esempio n. 1
0
 /**
  * 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()]);
 }