本文整理汇总了PHP中BaseController::ajaxCallback方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseController::ajaxCallback方法的具体用法?PHP BaseController::ajaxCallback怎么用?PHP BaseController::ajaxCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseController
的用法示例。
在下文中一共展示了BaseController::ajaxCallback方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ajaxCallback
protected function ajaxCallback()
{
// Transfere callback para métodos respectivos
switch ($this->action) {
case 'detail':
$json = $this->ajaxCallbackForProductApproval();
break;
default:
$json = parent::ajaxCallback();
break;
}
header('Content-Type: application/json');
exit(json_encode($json));
}
示例2: ajaxCallback
protected function ajaxCallback()
{
// Transfere callback para métodos respectivos
switch ($this->action) {
case 'faqSearch':
$json = $this->ajaxCallbackForSearch();
break;
case 'faqDetail':
$json = $this->ajaxCallbackForDetail();
break;
case 'faqRemove':
$json = $this->ajaxCallbackForRemove();
break;
default:
$json = parent::ajaxCallback();
break;
}
header('Content-Type: application/json');
exit(json_encode($json));
}
示例3: ajaxCallback
protected function ajaxCallback()
{
// Transfere callback para métodos respectivos
switch ($this->action) {
case 'typeSearch':
case 'brandSearch':
case 'messageSearch':
$json = $this->ajaxCallbackForSearch();
break;
case 'detail':
$json = $this->ajaxCallbackForProductApproval();
break;
case 'messageDetail':
$json = $this->ajaxCallbackForMessageApproval();
break;
case 'typeDetail':
$json = $this->ajaxCallbackForDetail();
if ($json['newID']) {
$json['disable'] = ['parent'];
$json['hide'] = ['messageContainer'];
$json['show'] = ['featureContainer'];
}
break;
case 'typeNewFeature':
$json = $this->ajaxCallbackForNewFeature();
break;
case 'brandDetail':
$json = $this->ajaxCallbackForPhoto();
break;
case 'typeRemove':
case 'brandRemove':
case 'messageRemove':
$json = $this->ajaxCallbackForRemove();
break;
default:
$json = parent::ajaxCallback();
break;
}
header('Content-Type: application/json');
exit(json_encode($json));
}
示例4: ajaxCallback
protected function ajaxCallback()
{
// Transfere callback para métodos respectivos
switch ($this->action) {
case 'mySales':
case 'myPurchases':
$json = $this->ajaxCallbackForSearch();
break;
default:
$json = parent::ajaxCallback();
break;
}
header('Content-Type: application/json');
exit(json_encode($json));
}
示例5: ajaxCallback
protected function ajaxCallback()
{
// Inicializa variáveis do JSON
$json['redirect'] = null;
// Transfere callback para métodos respectivos
switch ($this->action) {
case 'web':
switch ($this->authenticate($_POST)) {
case Config::read('authcode.error.userdata'):
// Dados inválidos
$json['message'] = Text::alertMessage("danger", Text::read('message.login.error.data'));
break;
case Config::read('authcode.error.blocked'):
// Usuário inativo
$json['message'] = Text::alertMessage("warning", Text::read('message.login.error.inactive'));
break;
case Config::read('authcode.error.mandatory'):
// Campos obrigatórios
$json['message'] = Text::alertMessage("danger", Text::read('message.login.error.mandatory'));
break;
default:
$json['redirect'] = Config::read('page.url.homepage');
break;
}
break;
case 'myAccount':
case 'newAccount':
$json = $this->ajaxCallbackForDetail();
if ($json['newID']) {
$json['redirect'] = Config::read('page.url.login.new-message');
}
break;
case 'password':
$json = $this->ajaxCallbackForPassword();
if ($json['newID']) {
$json['redirect'] = Config::read('page.url.login.password-message');
}
break;
default:
$json = parent::ajaxCallback();
break;
}
header('Content-Type: application/json');
exit(json_encode($json));
}