当前位置: 首页>>代码示例>>PHP>>正文


PHP App::getRouter方法代码示例

本文整理汇总了PHP中App::getRouter方法的典型用法代码示例。如果您正苦于以下问题:PHP App::getRouter方法的具体用法?PHP App::getRouter怎么用?PHP App::getRouter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在App的用法示例。


在下文中一共展示了App::getRouter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: restore

 public function restore()
 {
     $params = App::getRouter()->getParams();
     if (strlen($params[0]) > 0) {
         $res = $this->model->getRestorePass($params[0]);
         if ($params[0] == $res[0]['hash']) {
             // если хеш в базе найден - показать страницу с восстановлением и грохнуть записи из таблицы хеша
             $this->model->delRestorePass($res[0]['email'], $res[0]['hash']);
             // тут удалим из базы мыло и хеш логина при подтверждении
             $data = $res[0]['id_user'];
             $this->data['restore'] = $data;
         }
     } else {
         // проверим ответ
         if (count($_POST)) {
             if (!is_null($_POST['password']) && !is_null($_POST['password1']) && $_POST['password'] == $_POST['password1']) {
                 // и если все получено ок
                 $data = $_POST;
                 $this->model->saveNewPass($data);
                 // записать новый пароль
                 Router::redirect('/');
             }
         }
     }
 }
开发者ID:Skynet2004x,项目名称:SkynetPR,代码行数:25,代码来源:login.controller.php

示例2: view

 public function view()
 {
     $params = App::getRouter()->getParams();
     if (isset($params[0])) {
         $name = strtolower($params[0]);
         $this->data['project'] = $this->model->getByKoDescription($name);
     }
 }
开发者ID:Shketkol,项目名称:system_control_project,代码行数:8,代码来源:projects.controller.php

示例3: __construct

 function __construct($data = array())
 {
     $this->data = $data;
     $this->params = App::getRouter()->getParams();
     $this->params_get = App::getRouter()->getParamsGet();
     // adding global value accounts count to all controllers
     $this->data['account_count'] = (new Person())->getAccountCount();
 }
开发者ID:qconer,项目名称:php_kamgaz,代码行数:8,代码来源:controller.class.php

示例4: view

 public function view()
 {
     $params = App::getRouter()->getParams();
     if (isset($params[0])) {
         $id = strtolower($params[0]);
         $this->data['product'] = $this->model->getById($id);
     }
 }
开发者ID:RuslanSadyko,项目名称:Port4U,代码行数:8,代码来源:products.controller.php

示例5: admin_delete

 public function admin_delete()
 {
     $params = App::getRouter()->getParams();
     if (isset($params[0])) {
         $this->model->eventDelete($params[0]);
         Router::redirect('/admin/events');
     }
 }
开发者ID:niksib,项目名称:diploma,代码行数:8,代码来源:events.controller.php

示例6: view

 public function view()
 {
     $params = App::getRouter()->getParams();
     if (isset($params[0])) {
         $alias = strtolower($params[0]);
         $this->data['content'] = "Here will be a page with '{$alias}' alias";
     }
 }
开发者ID:maxevs,项目名称:homeworks,代码行数:8,代码来源:pages.controller.php

示例7: viev

 public function viev()
 {
     $params = App::getRouter()->getParams();
     if (isset($params[0])) {
         $alias = strtolower($params[0]);
         echo "Here will be a page with '{$alias}' alias";
     }
 }
开发者ID:YoGurtxo,项目名称:homeworks,代码行数:8,代码来源:pages.controller.php

示例8: view

 public function view()
 {
     $params = App::getRouter()->getParams();
     if (isset($params[0])) {
         $alias = strtolower($params[0]);
         $this->data['page'] = $this->model->getByAlias($alias);
     }
 }
开发者ID:SolonetsOleg,项目名称:mvc,代码行数:8,代码来源:pages.controller.php

示例9: admin_index

 public function admin_index()
 {
     if (Session::get('role') != 'admin') {
         Router::redirect('/');
     }
     $params = App::getRouter()->getParams();
     print_r($params);
     $this->data['pages'] = $this->model->getList($params[0]);
 }
开发者ID:tgamanov,项目名称:SkynetPR,代码行数:9,代码来源:pages.controller.php

示例10: view

 public function view()
 {
     $params = App::getRouter()->getParams();
     if (isset($params[0])) {
         $alias = strtolower($params[0]);
         $this->data['page'] = $this->model->getByAlias($alias);
     }
     $comments_model = new Comment();
     $this->data['comments'] = $comments_model->getByPageId($this->data['page']['id']);
 }
开发者ID:oleg-shumar,项目名称:php-academy.kiev.ua,代码行数:10,代码来源:pages.controller.php

示例11: getDefaultViewPath

 protected static function getDefaultViewPath()
 {
     $router = App::getRouter();
     if (!$router) {
         throw new Exception('Router was not found');
     }
     $controller_dir = $router->getController();
     $template_name = $router->getMethodPrefix() . $router->getAction() . '.php';
     return VIEWS_PATH . DS . $controller_dir . DS . $template_name;
 }
开发者ID:qconer,项目名称:php_kamgaz,代码行数:10,代码来源:view.class.php

示例12: getDefaultViewPath

 protected static function getDefaultViewPath()
 {
     $router = App::getRouter();
     if (!$router) {
         return false;
     }
     $controller_dir = $router->getController();
     $template_name = $router->getMethodPrefix() . $router->getAction() . '.html';
     return VIEWS_PATH . DS . $controller_dir . DS . $template_name;
 }
开发者ID:gudvon,项目名称:MySite,代码行数:10,代码来源:view.class.php

示例13: view

 public function view()
 {
     $params = App::getRouter()->getParams();
     $this->data['excInfo'] = $this->model->getExcursionById($params[0]);
     if (isset($params[0]) && isset($this->data['excInfo'])) {
         $this->data['userInfo'] = $this->model->getUserInfo($this->data['excInfo']['user_id']);
     } else {
         Router::redirect('/');
     }
 }
开发者ID:niksib,项目名称:diploma,代码行数:10,代码来源:excursions.controller.php

示例14: __construct

 public function __construct($data = array())
 {
     //session_start();
     if (isset($_SESSION['time']) && time() - $_SESSION['time'] > 3600) {
         session_destroy();
         Router::redirect('/');
         // session_start();
     }
     $_SESSION['time'] = time();
     $this->data = $data;
     $this->params = App::getRouter()->getParams();
 }
开发者ID:tgamanov,项目名称:SkynetPR,代码行数:12,代码来源:controller.class.php

示例15: add

 public function add()
 {
     $params = App::getRouter()->getParams();
     if (isset($params[0])) {
         $result = $this->model->add($_POST, $params[0]);
         if ($result) {
             Session::MessageSend(3, 'Ваш отзыв добавлен успешно.', '/users/reviews/' . $params[0]);
         } else {
             Session::MessageSend(1, 'Что-то пошлно не так, возможно вы не заполнили все поля.', '/users/reviews/' . $params[0]);
         }
     }
 }
开发者ID:niksib,项目名称:diploma,代码行数:12,代码来源:reviews.controller.php


注:本文中的App::getRouter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。