public function delete()
    {
        if (!userHasPermission('admin:blog:category:' . $this->blog->id . ':delete')) {

            unauthorised();
        }

        // --------------------------------------------------------------------------

        $id = $this->uri->segment(6);

        if ($this->blog_category_model->delete($id)) {

            $this->session->set_flashdata('success', 'Category was deleted successfully.');

        } else {

            $status   = 'error';
            $message  = 'There was a problem deleting the Category. ';
            $message .= $this->blog_category_model->lastError();
            $this->session->set_flashdata($status, $message);
        }

        redirect('admin/blog/category/index/' . $this->blog->id . $this->isModal);
    }
public function delete()
    {
        if (!userHasPermission('admin:blog:category:' . $this->blog->id . ':delete')) {

            unauthorised();
        }

        // --------------------------------------------------------------------------

        $id = $this->uri->segment(6);

        if ($this->blog_category_model->delete($id)) {

            $this->session->set_flashdata('success', 'Category was deleted successfully.');

        } else {

            $status   = 'error';
            $message  = 'There was a problem deleting the Category. ';
            $message .= $this->blog_category_model->lastError();
            $this->session->set_flashdata($status, $message);
        }

        redirect('admin/blog/category/index/' . $this->blog->id . $this->isModal);
    }
public function delete ( ) { if ( ! userHasPermission ( 'admin:blog:category:' . $ this -> blog -> id . ':delete' ) ) { unauthorised ( ) ; } // -------------------------------------------------------------------------- $ id = $ this -> uri -> segment ( 6 ) ; if ( $ this -> blog_category_model -> delete ( $ id ) ) { $ this -> session -> set_flashdata ( 'success' , 'Category was deleted successfully.' ) ; } else { $ status = 'error' ; $ message = 'There was a problem deleting the Category. ' ; $ message .= $ this -> blog_category_model -> lastError ( ) ; $ this -> session -> set_flashdata ( $ status , $ message ) ; } redirect ( 'admin/blog/category/index/' . $ this -> blog -> id . $ this -> isModal ) ; }
Delete a blog category
@return void
Delete a blog category