本文整理匯總了PHP中BaseView::renderJson方法的典型用法代碼示例。如果您正苦於以下問題:PHP BaseView::renderJson方法的具體用法?PHP BaseView::renderJson怎麽用?PHP BaseView::renderJson使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BaseView
的用法示例。
在下文中一共展示了BaseView::renderJson方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
/**
* [run description]
* @return [type] [description]
*/
public function run()
{
// init
$_log = $this->_log;
// get user input
$inputException = array();
$fetchInputResult = $this->fetchInput($inputException);
$this->_feedback->setCallback($this->input['callback']);
if (!$fetchInputResult) {
$feed = "";
$feed = Feedback::getFeed(false, $inputException, array(), $output_format, $input['callback']);
BaseView::renderJson($error_message);
return true;
}
// check token
$AccessibilityCheck = new AccessibilityCheck();
if ($AccessibilityCheck->isTokenIllegal($UnsubscribeRequest)) {
$feed = "";
$feed = Feedback::getBaseFeed(false, FeedbackInfo::ILLEGAL_TOKEN, array(), $this->output_format, $this->input['callback']);
BaseView::renderJson($feed);
return true;
}
// storage data
$this->initDatabaseModel();
if (!$this->AllSubscribeStorage->unsubByUidSubid($UnsubscribeRequest)) {
$feed = "";
$feed = Feedback::getBaseFeed(false, FeedbackInfo::UNSUB_FAILED_BY_STORAGE, null, $this->output_format, $this->input['callback']);
BaseView::renderJson($feed);
return true;
}
// cache data
if (!$this->UserSubscribeCache->removeUserSub($UnsubscribeRequest)) {
$feed = "";
$feed = Feedback::getBaseFeed(false, FeedbackInfo::UNSUB_FAILED_BY_CACHE, null, $this->output_format, $this->input['callback']);
BaseView::renderJson($feed);
return true;
}
// decrease cache num
$this->SubscribeNumCache->decreaseSubNum($UnsubscribeRequest);
// feedback ok
$feed = "";
$feed = Feedback::getBaseFeed(true, FeedbackInfo::OK, null, $this->output_format, $this->input['callback']);
BaseView::renderJson($feed);
return true;
}