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); }
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'); } } }
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)); }
function init() { $data = \Scrawler\Core\site()->db()->get_site(); $this->config = array('site' => $data[0], 'name' => $data[1], 'description' => $data[2]); }