public function show404() { if (Request::isPost()) { $page = App::collection(self::PAGES_COLLECTION)->create(Input::get('page')); Request::redirect($page->slug); } $layouts = array(); $layout_files = glob(Router::config('paths')['root'] . 'app/views/layouts/*'); foreach ($layout_files as $layout_file) { $layout_ext = pathinfo($layout_file, PATHINFO_EXTENSION); $layout_name = basename($layout_file, '.' . $layout_ext); $words = preg_split('/_/', $layout_name); $layout_label = join(' ', array_map(function ($word) { return ucfirst($word); }, $words)); $layouts[$layout_name] = $layout_label; } $this->render('cms/404', array('request_path' => Request::path(), 'layouts' => $layouts)); }
public function getLogout() { Cookie::delete('is_admin'); Request::redirect('/admin'); }
public function index() { Cookie::set('admin', 1); Request::redirect('/hook-framework'); }