Example #1
0
 private function __construct($lang)
 {
     $this->conf = Config::run();
     $this->conf->loadFromFile(Config::getConfPath('lang'));
     if ($lang === null) {
         $this->lang = $this->conf->getField('default');
     }
     $this->loadFromFile($this->conf->getField('langPath'));
 }
Example #2
0
 public function init($conf)
 {
     $this->config = new Config();
     $this->config->loadFromFile(Config::getConfPath('router'));
     if ($this->config->getField('requestUri')) {
         $this->requestUri = $this->config->getField('requestUri');
     } else {
         $this->requestUri = $_SERVER['REQUEST_URI'];
     }
 }
Example #3
0
 /**
  * @param $view
  * @throws \Exception
  */
 public function __construct($view)
 {
     $this->dom = Dom::run();
     $this->imgPath = $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . '/kernel/resources/img/splash/';
     $this->config = Config::run();
     $this->config->loadFromFile(Config::getConfPath('splash'));
     $this->logo = $this->config->getField('logo');
     $this->view = $view;
     $this->view->initConfig('main');
 }
Example #4
0
 public static function getAppTitle($title = null, $echo = false)
 {
     if ($title === null) {
         $config = Config::run();
         $config->loadFromFile(Config::getConfPath('application'));
         $title = $config->getField('name');
     }
     if ($echo) {
         echo $title;
     } else {
         return $title;
     }
 }
Example #5
0
 public function init($initConfig = null)
 {
     $this->config = new Config();
     $this->config->loadFromFile(Config::getConfPath('application'));
 }
Example #6
0
 public function __construct()
 {
     $this->config = Config::run();
     $this->config->loadFromFile(Config::getConfPath('db'));
     $this->connect($this->config->getField('host'), $this->config->getField('user'), $this->config->getField('password'));
 }
Example #7
0
 public function init($config = null)
 {
     $this->config = Config::run();
     $this->config->loadFromFile(Config::getConfPath('auth'));
 }
Example #8
0
 /**
  * @param $controllerName
  * @throws \Exception
  */
 public function initConfig($controllerName)
 {
     $this->config = new Config();
     $this->config->loadFromFile(Config::getConfPath('view'));
     $this->viewPath = $this->config->getField('viewPath') . $controllerName . DIRECTORY_SEPARATOR;
 }