Пример #1
0
 public function indexAction()
 {
     $pageModel = $this->model('page');
     $alias = xsCleanLatinName($this->httpRequest->arg(0) ? $this->httpRequest->arg(0) : 'index');
     $pageModel->__set('alias', $alias);
     $pageModel->read($alias);
     $this->data = $pageModel->__get_array();
 }
Пример #2
0
 private function loadController()
 {
     $httpRequest = HttpRequest::getInstance();
     if ($httpRequest->arg(0) && $this->mod_exists(xsCleanLatinName($httpRequest->arg(0)), 'controllers')) {
         $this->controller = xsCleanLatinName($httpRequest->arg(0));
         if ($httpRequest->arg(1)) {
             $this->action = xsCleanLatinName($httpRequest->arg(1));
         } else {
             $this->action = $this->config['default_action'];
         }
     } else {
         $this->controller = $this->config['default_controller'];
         $this->action = $this->config['default_action'];
     }
     $this->params = $httpRequest->getParams();
     $this->load($this->controller, 'controllers');
 }