Yehonatan

Frame.php

Jul 31st, 2012
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.78 KB | None | 0 0
  1. <?php
  2.    
  3.    
  4.      abstract class frame extends Loader
  5.     {
  6.        
  7.         public function __construct()
  8.         {
  9.            
  10.             parent::__construct();
  11.             if(method_exists($this, $this->url_data['function']) && $this->url_data['function'] != '__construct' && $this->url_data['function'] != $this->url_data['controller'])
  12.             {
  13.  
  14.                 $function =  $this->url_data['function'];
  15.                 $this->$function();
  16.             }
  17.             elseif($this->url_data['function'] != '' && !method_exists($this, $this->url_data['function']))
  18.             {
  19.                 $this->view->loadSelected("404");
  20.             }
  21.                
  22.         }
  23.        
  24.        
  25.         protected function get_view_name($class)
  26.         {
  27.             return get_class("view/views/" . $class);
  28.         }
  29.        
  30.         protected function load_model($name)
  31.         {
  32.             require_once(dirname(dirname(__FILE__)) . "/models/" . $name . ".php");
  33.         }
  34.        
  35.     }
Advertisement
Add Comment
Please, Sign In to add comment