public function before() { // Выполняем функцию родительского класса parent::before(); //var_dump($this->styles) $this->template->styles = $this->getStyles($this->styles); }
public function before() { if (!Auth::instance()->logged_in('admin')) { HTTP::redirect('login'); } parent::before(); $this->template->styles = array('/media/css/admin.css', 'media/css/jquery.fancybox.css'); $this->template->scripts = array('/media/js/jquery.js', '/media/js/MultiFile.pack.js', '/media/js/upload.js', '/media/js/jquery.fancybox.pack.js', '/media/js/demo.js'); }
public function action_start() { parent::action_start(); if ($this->request->post('action') === 'registration') { $this->startRegistr(); } $this->getMainView()->body = $this->getRegView(); $this->response->body($this->getMainView()); }
public function action_start() { parent::action_start(); if ($this->request->post('action') === 'authorization') { $this->setAuthorization($this->request->post('nick'), $this->request->post('password')); } $this->getMainView()->body = $this->getAuthView(); $this->response->body($this->getMainView()); }
function before() { parent::before(); $this->template->styles = array("media/css/style.css", 'media/css/jquery.fancybox.css'); $this->template->scripts = array('/media/js/jquery.js', '/media/js/jquery.fancybox.pack.js', '/media/js/demo.js'); $mod_search = module::load('search'); $menu_top = module::load('menutop'); $this->template->menu_top = array($menu_top); $this->template->search = array($mod_search); }
public function before() { parent::before(); $category = new Model_Category('tree'); //ВИДЖЕТЫ ДЛЯ ВСЕХ СТРАНИЦ САЙТА! $categoryId = 0; $this->widgets = $this->getWidgets($categoryId); if (is_array($this->widgets)) { foreach ($this->widgets as $position => $widget) { $this->template->{$position} = $widget; } } }
public function before() { parent::before(); $category = new Model_Category('tree'); //ВИДЖЕТЫ ДЛЯ ВСЕХ СТРАНИЦ САЙТА! $categoryId = 0; $this->widgets = $this->getWidgets($categoryId); if (is_array($this->widgets)) { foreach ($this->widgets as $position => $widget) { $this->template->{$position} = $widget; } } $old_styles = $this->template->styles; array_unique($this->styles); $new_styles = array_merge($this->styles, $old_styles); $this->template->styles = $new_styles; $old_scripts = $this->template->scripts; array_push($old_scripts, 'http://api-maps.yandex.ru/2.0-stable/?load=package.standard&lang=ru-RU'); $this->template->scripts = $old_scripts; //Виджеты //$menu = Request::factory('widgets/menu')->execute(); //Вывод в шаблон //$this->template->block_left = array($menu); }
public function before() { // Выполняем функцию родительского класса parent::before(); }
<?php session_start(); include_once "Model/Model_Login.php"; include_once "Model/Model_Home.php"; include_once "View/View_Login_Logout.php"; include_once "View/View_Home.php"; include_once "Controller/Controller_Main.php"; // load Controller $controller_main = new Controller_Main(new Model_Login(), new Model_Home(), new View_Login_Logout(), new View_Home()); $controller_main->invoke(); //session_unset();
public function __construct($request, $response) { parent::__construct($request, $response); $this->init(); }
<?php $router = new \Klein\Klein(); // Главная страница $router->respond('GET', '/', function () { $controller = new Controller_Main(); return $controller->action_index(); }); // Страница каталога $router->respond(array('GET', 'POST'), '/products/?', function ($request, $response) { $controller = new Controller_Products(); $messages = ['success_message' => '', 'error_message' => '']; $action = $request->action; switch ($action) { case 'new': if (!empty($_POST['title'])) { $messages = $controller->addCategory($request->title); } else { $messages['error_message'] = 'Укажите имя категории'; } break; case 'edit': if (!empty($_POST['title'])) { $messages = $controller->editCategory($request->id, $request->title); } else { $messages['error_message'] = 'Укажите имя категории'; } break; case 'delete': $messages = $controller->deleteCategory($request->id); break;
function __construct() { $this->model = new Model_Main(); $this->view = new View(); self::$title = 'Site title'; }
public function before() { parent::before(); $this->setCSS('registration')->setJS('registration')->setJS('lib')->setDescription('Форма для регистрации пользователей!')->setKeyWords('регистация, пользователей, на сайте, форма')->setTitle('Форма для регистрации пользователей')->initMainParams(); $this->setRegView(); }
public function before() { parent::before(); $this->articleRepository = new Repositories_ArticleRepository(); }