Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1.     function action_view()
  2.     {
  3.         $get = new Validate($_GET);
  4.         $get = Validate::factory($_GET)->rule('article_id', 'is_numeric');
  5.        
  6.         if(!$get->check())
  7.         {
  8.             $this->errors = $get->errors('article_id');
  9.            
  10.             $view = View::factory('error')
  11.             ->set('errors', $this->errors);
  12.            
  13.             $this->template->content = $view;
  14.         }
  15.         else
  16.         {
  17.             $article = new Model_Article;
  18.            
  19.             if(isset($_GET['article_id']))
  20.             {
  21.                 if($article->exists($_GET['article_id']))
  22.                 {
  23.                     $this->template->content = 'true';
  24.                 }
  25.                 else
  26.                 {
  27.                    
  28.                     $this->template->content = 'false';
  29.                 }
  30.             }
  31.         }
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement