Beispiel #1
0
 public function __construct()
 {
     $this->_page = InRouter::getController();
     $this->_theme = new InTheme();
     $this->_theme->page = $this->_page;
     $this->_theme->path = InRouter::getContext();
     $this->_theme->view = $this->_page;
     if ($this->_page) {
         $theme = $this->_theme;
         $project = $this;
         require_once IN_CONTROLLERS_PATH . '/' . InRouter::getContext() . '/' . InRouter::getController() . '.php';
     }
 }
Beispiel #2
0
 public function __construct()
 {
     $this->_page = InRouter::getController();
     $this->_theme = new InTheme();
     $this->_theme->page = $this->_page;
     $this->_theme->path = InRouter::getContext();
     $this->_theme->view = $this->_page;
     // Project dependencies
     $dep_path = dirname(dirname(dirname(dirname(__FILE__)))) . '/project/index.php';
     if (file_exists($dep_path)) {
         require_once $dep_path;
     }
     // Load Controller
     if ($this->_page) {
         $theme = $this->_theme;
         $project = $this;
         require_once IN_CONTROLLERS_PATH . '/' . InRouter::getContext() . '/' . InRouter::getController() . '.php';
     }
 }
Beispiel #3
0
 protected function _validateParams()
 {
     $type = InRouter::getParams();
     switch ($type) {
         case 'POST':
             $source = $_POST;
             break;
         default:
             $source = $_GET;
             break;
     }
     $params = InRouter::getContext();
     if ($params && is_array($params) && count($params) > 0) {
         foreach ($params as $p) {
             if (isset($source[$p])) {
                 $this->_params[$p] = $source[$p];
             } else {
                 $this->setError(422);
                 return false;
             }
         }
     }
     return true;
 }