public function addPostAction()
 {
     if (!$this->isAdmin()) {
         return $this->redirect('home');
     } else {
         $_SESSION['KCFINDER']['disabled'] = false;
     }
     if ($this->isPostRequest()) {
         $file_image = $_FILES['img-file'];
         $datapost = $this->getPostData();
         $datapost['poster'] = $_SESSION['logged']['id'];
         $datapost['image'] = $this->setImageName($file_image);
         if (Post::add_post($datapost)) {
             $this->saveImage($file_image, $this->IMG_POST_DIR, $datapost['image']);
         }
         return $this->redirect('managerpost');
     } else {
         $data = $this->setData();
         $data['title'] = 'Trang quản lý';
         return $this->render('admin/addpost.html.twig', $data);
     }
 }