Пример #1
0
 function init()
 {
     $this->t = \Scrawler\Core\site()->template();
     $site = \Scrawler\Core\site()->config()->site;
     $this->t->addData(['site' => $site]);
     \Scrawler\Core\site()->session()->start_session('_s', false);
 }
Пример #2
0
 function post()
 {
     if (isset($_POST['email']) && isset($_POST['password'])) {
         $email = $_POST['email'];
         $password = $_POST['password'];
         $login = \Scrawler\Core\site()->db()->login($email, $password);
         if ($login) {
             header('Location: http://' . $_SERVER['SERVER_NAME'] . '/admin');
         }
     }
 }
Пример #3
0
 function get()
 {
     echo $this->t->render('home', array('posts' => \Scrawler\Core\site()->post()->view(), 'name' => \Scrawler\Core\site()->config()->name, 'description' => \Scrawler\Core\site()->config()->description));
 }
Пример #4
0
 function init()
 {
     $data = \Scrawler\Core\site()->db()->get_site();
     $this->config = array('site' => $data[0], 'name' => $data[1], 'description' => $data[2]);
 }