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


PHP FrontController::getInstance方法代码示例

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


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

示例1: updateACL

 /**
  * save User ACL settings
  */
 public function updateACL($section = '')
 {
     $id = $this->obj->getUid();
     if (!$id) {
         return false;
     }
     $objLst = new AclModel();
     $objLst->connectDb();
     if (is_string($section)) {
         $objLst->where("section='{$section}'");
     }
     if (!$objLst->loadList()) {
         return false;
     }
     $i = 0;
     $fc = FrontController::getInstance();
     $db = DbConnector::getConnection();
     $table = $objLst->dbTable('acl_user');
     while ($objLst->next()) {
         if ($fc->getReqVar('acl_' . $objLst->get('name'))) {
             $db->query('INSERT IGNORE INTO `' . $table . '` SET `user_id`=' . $id . ', `acl_id`=' . $objLst->getUid());
         } else {
             $db->query('DELETE IGNORE FROM `' . $table . '` WHERE `user_id`=' . $id . ' AND `acl_id`=' . $objLst->getUid());
         }
         $i++;
     }
     return $i;
 }
开发者ID:jaeko44,项目名称:time-tracking,代码行数:31,代码来源:auth_acl.php

示例2: indexAction

 function indexAction()
 {
     if (!$this->postAds) {
         $view = new installView();
         $result = $view->render();
         //показываем форму установки
     } else {
         $errMes = $this->postConfig($this->postAds);
         //получаем результат после проверки пост данных
         if (!empty($errMes)) {
             $view = new installView();
             $result = $view->render($errMes);
             //показываем форму установки
         } else {
             $this->db = DB::Conn();
             if (!is_object($this->db)) {
                 $view = new installView();
                 $result = $view->render($this->db);
                 //показываем форму установки
             } else {
                 header('Location: http://' . $_SERVER['HTTP_HOST']);
             }
         }
     }
     $fc = FrontController::getInstance();
     $fc->setBody($result);
 }
开发者ID:slimko,项目名称:test,代码行数:27,代码来源:InstallController.php

示例3: showAll

 public function showAll()
 {
     $fc = FrontController::getInstance();
     $dbh = $fc->connect();
     $sql = "\n\t\t\tSELECT listenerName, listenerTitle, status, moderatedTime\n\t\t\t\tFROM listener \n\t\t\t\t\tORDER by moderatedTime\n\t\t";
     $sth = $dbh->prepare($sql);
     $sth->execute();
     $result = $sth->fetchAll(PDO::FETCH_ASSOC);
     foreach ($result as $item) {
         switch ($item['status']) {
             case 0:
                 $status = "На модерации";
                 break;
             case 1:
                 $status = "<span class='text-success'>Одобрено</span>";
                 break;
             case 2:
                 $status = "<span class='text-danger'>Отклонено</span>";
                 break;
             case 3:
                 $status = "<span class='text-info'>В архиве</span>";
                 break;
         }
         echo "<tr>\n\t\t\t\t\t<td>{$item['listenerName']}</td>\n\t\t\t\t\t<td>{$item['listenerTitle']}</td>\n\t\t\t\t\t<td>{$status}</td>\n\t\t\t\t\t<td>";
         echo $item[moderatedTime] != 0 ? date("d-m-Y H:i:s", $item[moderatedTime]) : "";
         echo "</td>\n\t\t\t\t</tr>";
     }
 }
开发者ID:sarmaGit,项目名称:orbis,代码行数:28,代码来源:StatisticModel.php

示例4: run

 public function run()
 {
     if ($this->getConfigFolder() == null) {
         $this->setConfigFolder('../config');
     }
     $this->frontController = FrontController::getInstance();
     if ($this->router == null) {
         $this->router = new DefaultRouter();
     }
     $this->frontController->setRouter($this->router);
     $sess = $this->config->app['session'];
     if (isset($sess['autostart'])) {
         if ($sess['type'] == 'native') {
             $s = new NativeSession($sess['name'], $sess['lifetime'], $sess['path'], $sess['domain'], $sess['secure']);
             $http = new HttpContext(null, $s);
         }
         $this->setHttpContext($http ?? new HttpContext());
     }
     if (isset($this->config->app['identity']['userClass'])) {
         $userConfigClass = $this->config->app['identity']['userClass'];
         $this->identity = new Identity($userConfigClass, new SimpleDB());
     } else {
         $this->identity = new Identity(new IdentityUser(null, null), new SimpleDB());
     }
     $this->frontController->dispatch();
 }
开发者ID:ksevery,项目名称:MVCEndProject,代码行数:26,代码来源:Application.php

示例5: __construct

 public function __construct($obj)
 {
     parent::__construct($obj);
     $this->fc = FrontController::getInstance();
     $this->error = '';
     $this->isLoggedIn = $this->isLoggingOut = false;
 }
开发者ID:TheSoul75,项目名称:time-tracking,代码行数:7,代码来源:auth.php

示例6: __construct

 public function __construct()
 {
     $fc = FrontController::getInstance();
     $this->params = $fc->getParams();
     $this->format = $fc->getFormat();
     $this->makeObj();
 }
开发者ID:andrianoUkr,项目名称:webden,代码行数:7,代码来源:IndexController.php

示例7: indexAction

 public function indexAction()
 {
     $fc = FrontController::getInstance();
     $admin = new Admin();
     $output = $admin->render(ADMIN_TEMPLATE, ADMIN_LOGIN);
     $fc->setBody($output);
 }
开发者ID:TimaVox,项目名称:First-MVC,代码行数:7,代码来源:AdminController.php

示例8: indexAction

 public function indexAction()
 {
     $fc = FrontController::getInstance();
     $model = new PageModel();
     header('HTTP/1.0 Not Found');
     $fc->setBody($model->render('404.php', TEMPLATE));
 }
开发者ID:OzoneRPC,项目名称:mvc.ozone.project,代码行数:7,代码来源:NotFoundController.php

示例9: indexAction

 public function indexAction()
 {
     $fc = FrontController::getInstance();
     $view = new DefaultModel();
     $out = $view->showIndexPage();
     $fc->setBody($out);
 }
开发者ID:onpavlov,项目名称:Auto_Playlist_v2,代码行数:7,代码来源:IndexController.php

示例10: run

 public static function run($request)
 {
     if (!$request instanceof Request) {
         $request = new Request($request);
     }
     $file = $request->getFile();
     $class = $request->getClass();
     $method = $request->getMethod();
     $args = $request->getArgs();
     $front = FrontController::getInstance();
     $registry = $front->getRegistry();
     $registry->oRequest = $request;
     $front->setRegistry($registry);
     if (file_exists($file)) {
         require_once $file;
         $rc = new ReflectionClass($class);
         // if the controller exists and implements IController
         //			if($rc->implementsInterface('IController'))
         if ($rc->isSubclassOf('BaseController')) {
             try {
                 $controller = $rc->newInstance();
                 $classMethod = $rc->getMethod($method);
                 return $classMethod->invokeArgs($controller, $args);
             } catch (ReflectionException $e) {
                 throw new MvcException($e->getMessage());
             }
         } else {
             //				throw new MvcException("Interface iController must be implemented");
             throw new MvcException("abstract class BaseController must be extended");
         }
     } else {
         throw new MvcException("Controller file not found");
     }
 }
开发者ID:ngukho,项目名称:mvc-cms,代码行数:34,代码来源:Module.class.php

示例11: indexAction

 public function indexAction()
 {
     $fc = FrontController::getInstance();
     $view = new LoginModel();
     $out = $view->showLoginPage();
     $view->status = $fc->status;
     $fc->setBody($out);
 }
开发者ID:onpavlov,项目名称:Auto_Playlist_v2,代码行数:8,代码来源:LoginController.php

示例12: indexAction

 function indexAction()
 {
     $fc = FrontController::getInstance();
     $model = new TestModel();
     $model->name = $fc->getParams();
     $output = $model->render('../views/index.php');
     $fc->setBody($output);
 }
开发者ID:ralf000,项目名称:PHP4,代码行数:8,代码来源:IndexController.class.php

示例13: init

 /**
  * Initialise application
  */
 public function init()
 {
     $this->_paths = self::$_mainCfg['application']['paths'];
     $this->setIncludePath($this->_paths);
     $this->setAutoload();
     $this->_fc = FrontController::getInstance();
     ErSession::startSession();
 }
开发者ID:G-Grand,项目名称:webosen2014_diplom,代码行数:11,代码来源:ErApplication.php

示例14: getUserRole

 function getUserRole()
 {
     $fc = FrontController::getInstance();
     $usersList = $this->getUsersList();
     $userName = key($this->user);
     if (array_key_exists($userName, $usersList)) {
         return [$userName => $usersList[$userName]];
     }
 }
开发者ID:ralf000,项目名称:PHP4,代码行数:9,代码来源:UserModel.class.php

示例15: getAction

 function getAction()
 {
     $fc = FrontController::getInstance();
     $model = new UserModel();
     $model->user = $fc->getParams();
     $model->userRole = $model->getUserRole();
     $output = $model->render('../views/userRole.php');
     $fc->setBody($output);
 }
开发者ID:ralf000,项目名称:PHP4,代码行数:9,代码来源:UserController.class.php


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