本文整理汇总了PHP中Shineisp_Commons_Utilities::isAjax方法的典型用法代码示例。如果您正苦于以下问题:PHP Shineisp_Commons_Utilities::isAjax方法的具体用法?PHP Shineisp_Commons_Utilities::isAjax怎么用?PHP Shineisp_Commons_Utilities::isAjax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shineisp_Commons_Utilities
的用法示例。
在下文中一共展示了Shineisp_Commons_Utilities::isAjax方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: errorAction
public function errorAction()
{
$errors = $this->_getParam('error_handler');
$mex = $this->_getParam('mex');
// Ajax controll
if (Shineisp_Commons_Utilities::isAjax()) {
echo json_encode($errors->exception->getMessage());
die;
}
switch ($errors->type) {
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
// 404 error -- controller or action not found
$this->getResponse()->setHttpResponseCode(404);
$this->view->message = 'Controller has been not found';
break;
case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
// 404 error -- controller or action not found
$this->getResponse()->setHttpResponseCode(404);
$this->view->message = 'Action has been not found';
break;
default:
// application error
$this->getResponse()->setHttpResponseCode(500);
$this->view->message = $errors->exception->getMessage();
break;
}
if (!empty($mex)) {
$this->view->message .= "<br/><b>{$mex}</b>";
}
// Save the error message in the log file errors.log
$errormessage = $errors->type . ": " . $errors->exception->getMessage();
Shineisp_Commons_Utilities::log($errormessage);
$this->view->exception = $errors->exception;
$this->view->request = $errors->request;
}