Beispiel #1
0
 public function __call($method, $args)
 {
     //for social links
     $links = new Application_Model_SocialLinks();
     $this->view->links = $links->getSocialLinks();
     if ('Action' == substr($method, -6)) {
         // If the action method was not found, render the error
         // template
         $page = substr($method, 0, -6);
         //is this page name is present in any url slug
         $results = $this->post->getPostByUrl($page);
         if ($results == true) {
             $this->view->page_data = $results;
             if ($results->is_comment == 0) {
                 $result = $this->comment->getCommentsByPost($results->post_id);
                 $this->view->comment = $result;
                 $form = new Application_Form_CommentForm();
                 $this->view->form = $form;
             }
             return $this->render('page');
         } else {
             return $this->render('post-not-found');
         }
     }
     // all other methods throw an exception
     throw new Exception('Invalid method "' . $method . '" called', 500);
 }
Beispiel #2
0
 public function galleryAction()
 {
     $links = new Application_Model_SocialLinks();
     $this->view->links = $links->getSocialLinks();
     $results = $this->photos->getAllPhotos();
     $this->view->images = $results;
 }