Example #1
0
 /**
  * 
  */
 public function postAction()
 {
     $slug = $this->getPost('slug');
     $type = $this->getPost('type');
     $postService = PostService::getSingleton();
     $postService->setName($slug);
     $postService->setPostType($type);
     $posts = $postService->getPosts();
     if (count($posts) > 0) {
         return array("post" => $posts[0]->toArray());
     } else {
         return array("post" => null);
     }
 }