本文整理汇总了PHP中fRequest::isAjax方法的典型用法代码示例。如果您正苦于以下问题:PHP fRequest::isAjax方法的具体用法?PHP fRequest::isAjax怎么用?PHP fRequest::isAjax使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fRequest
的用法示例。
在下文中一共展示了fRequest::isAjax方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Consumable
// Get objects matching the printer/consumable
$consumable = new Consumable($consumable_id);
// Update cost if present
if ($cost) {
$consumable->setCost($cost);
$consumable->store();
}
// Update consumable
$updated = $consumable->increaseStockBy($qty);
#die(var_export($updated));
// Check status of installation
if ($updated == FALSE) {
fMessaging::create('error', $redirect, $consumable->err);
fURL::redirect($redirect);
} else {
fMessaging::create('success', $redirect, sprintf('The consumable stock for %s has been updated.', $consumable->getName()));
fURL::redirect($redirect);
}
} catch (fNotFoundException $e) {
fMessaging::create('error', $redirect, 'The requested object with ID ' . $id . ', could not be found.');
fURL::redirect($redirect);
}
} else {
// Get consumable object from ID
if ($consumable_id != NULL) {
$c = Consumable::getOne($consumable_id);
}
// No POSTed data, show form (based on request method)
$view = fRequest::isAjax() ? 'ajax.php' : 'simple.php';
include 'views/stock/' . $view;
}