本文整理汇总了PHP中ErrorHandler::_outputMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP ErrorHandler::_outputMessage方法的具体用法?PHP ErrorHandler::_outputMessage怎么用?PHP ErrorHandler::_outputMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ErrorHandler
的用法示例。
在下文中一共展示了ErrorHandler::_outputMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function _outputMessage($template, $layout = 'error')
{
/*
* Use an error layout
* @link http://nuts-and-bolts-of-cakephp.com/2009/04/30/give-all-of-your-error-messages-a-different-layout/
*/
$this->controller->layout = $layout;
return parent::_outputMessage($template);
}
示例2: env
/**
* Output message
*
* @access protected
*/
function _outputMessage($template)
{
$isAjax = env('HTTP_X_REQUESTED_WITH') === "XMLHttpRequest";
if ($this->_requested || $isAjax) {
$this->controller->autoLayout = false;
$this->controller->params['bare'] = true;
}
// show 'page title' only once
if (empty($this->controller->viewVars['title_for_layout']) && !empty($this->controller->viewVars['title'])) {
$this->controller->viewVars['title_for_layout'] = $this->controller->viewVars['title'];
$this->controller->viewVars['title'] = null;
}
parent::_outputMessage($template);
}
示例3:
function _outputMessage($template)
{
$this->controller->set(array('home' => false));
return parent::_outputMessage($template);
}
示例4: _outputMessage
/**
* Force using limited layout for errors
*
* @param string $template Template to render
*/
public function _outputMessage($template)
{
$this->controller->layout = 'ajax';
parent::_outputMessage($template);
}