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


PHP ErrorHandler::displayNotFoundError方法代码示例

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


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

示例1: render

 public function render()
 {
     $result = false;
     if (method_exists($this, "_beforeRender")) {
         $result = $this->_beforeRender();
         if ($result == -1) {
             // We are not authenticated to use this action
             ErrorHandler::displayForbiddenError();
             return false;
         }
         if ($result === 0) {
             // Some error has ocurred
             ErrorHandler::displayNotFoundError();
             return false;
         }
         if ($result === 1) {
             // Ok, dispatch the action
             try {
                 require_once $this->_controllerFile;
                 $controllerObj = new $this->_controllerName();
                 if (method_exists($controllerObj, $this->_action)) {
                     $action = $this->_action;
                     $controllerObj->{$action}();
                 } else {
                     ErrorHandler::displayNotFoundError();
                     trigger_error("Dispatcher | Error: Action {$action} does not exists in controller {$this->_controllerName}", E_USER_WARNING);
                 }
             } catch (Exception $ex) {
                 trigger_error("Dispatcher | An unexpected exception has been produced while trying to dispatch {$action} in controller {$this->_controllerName}: {$ex->getMessage()} ", E_USER_WARNING);
             }
         } else {
             ErrorHandler::displayNotFoundError();
             return false;
         }
     }
     if (method_exists($this, "_afterRender")) {
         $result = $this->_afterRender();
         return $result;
     }
 }
开发者ID:andreums,项目名称:framework1.5,代码行数:40,代码来源:AppEngine.class.php

示例2: renderView

 /**
  * Tries to render a view of a plugin
  *
  * @param $view string The name of the view
  * @return void
  */
 public function renderView($view)
 {
     try {
         $route = "";
         $route .= $this->getPluginsPath();
         $route .= DS;
         $route .= $this->getPluginName();
         $route .= DS . "view" . DS;
         $route .= $view . ".php";
         if (file_exists($route)) {
             include $route;
         } else {
             ErrorHandler::displayNotFoundError();
         }
     } catch (Exception $ex) {
         trigger_error("PLUGIN | Plugin {$this->getPluginName()} cannot render view {$view}", E_USER_WARNING);
     }
 }
开发者ID:andreums,项目名称:framework1.5,代码行数:24,代码来源:BasePlugin.class.php

示例3: renderView

 /**
  * Render a view
  *
  * @param  string $view The name of the view
  * @access public
  * @return void
  */
 public function renderView($view)
 {
     try {
         $route = "";
         $config = Config::getInstance();
         $route .= $config->getmodulePath();
         $route .= "/";
         $route .= $this->_getControllerName();
         $route .= "/";
         $route .= $config->getviewPath();
         $route .= "/";
         $route .= $view . ".php";
         if (file_exists($route)) {
             include $route;
         } else {
             ErrorHandler::displayNotFoundError();
         }
     } catch (Exception $ex) {
         print $ex->getMessage();
     }
 }
开发者ID:andreums,项目名称:framework1.5,代码行数:28,代码来源:BaseController.class.php

示例4: _dispatchError

 /**
  * Dispatches an error
  *
  * @return bool
  */
 private function _dispatchError()
 {
     if ($this->_hasResult === false && $this->_router->getType() != "plugin") {
         $engine = new AppEngine();
         $engine->setParams("index", "index", "indexFirst");
         $engine->render();
         ErrorHandler::displayNotFoundError();
         $engine->setParams("index", "index", "indexLast");
         $engine->render();
         return true;
     }
     return false;
 }
开发者ID:andreums,项目名称:framework1.5,代码行数:18,代码来源:Dispatcher.class.php


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