Example #1
0
 function indexAction()
 {
     if (!$this->postAds) {
         $view = new installView();
         $result = $view->render();
         //показываем форму установки
     } else {
         $errMes = $this->postConfig($this->postAds);
         //получаем результат после проверки пост данных
         if (!empty($errMes)) {
             $view = new installView();
             $result = $view->render($errMes);
             //показываем форму установки
         } else {
             $this->db = DB::Conn();
             if (!is_object($this->db)) {
                 $view = new installView();
                 $result = $view->render($this->db);
                 //показываем форму установки
             } else {
                 header('Location: http://' . $_SERVER['HTTP_HOST']);
             }
         }
     }
     $fc = FrontController::getInstance();
     $fc->setBody($result);
 }
Example #2
0
 function __construct()
 {
     $this->bd = DB::Conn();
     //подключаемся к базе данных
     /** создаем объект библиотеки вывода Смарти и настраиваем его **/
     $this->smarty = new Smarty();
     //класс внешнего шаблонизатора
     //настройки Смарти
     $this->smarty->compile_check = true;
     $this->smarty->debugging = false;
     $this->smarty->template_dir = './application/views';
     $this->smarty->compile_dir = './lib/smarty/templates_c';
     $this->smarty->cache_dir = './lib/smarty/cache';
     $this->smarty->config_dir = './lib/smarty/configs';
     /** Закончили  **/
 }