本文整理汇总了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;
}
}
示例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);
}
}
示例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();
}
}
示例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;
}