本文整理匯總了PHP中Nette\Callback::isStatic方法的典型用法代碼示例。如果您正苦於以下問題:PHP Callback::isStatic方法的具體用法?PHP Callback::isStatic怎麽用?PHP Callback::isStatic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Nette\Callback
的用法示例。
在下文中一共展示了Callback::isStatic方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: exportRules
/**
* @return array
*/
protected static function exportRules($rules)
{
$payload = array();
foreach ($rules as $rule) {
if (!is_string($op = $rule->operation)) {
$op = new Nette\Callback($op);
if (!$op->isStatic()) {
continue;
}
}
if ($rule->type === Rule::VALIDATOR) {
$item = array('op' => ($rule->isNegative ? '~' : '') . $op, 'msg' => $rules->formatMessage($rule, FALSE));
} elseif ($rule->type === Rule::CONDITION) {
$item = array('op' => ($rule->isNegative ? '~' : '') . $op, 'rules' => self::exportRules($rule->subRules), 'control' => $rule->control->getHtmlName());
if ($rule->subRules->getToggles()) {
$item['toggle'] = $rule->subRules->getToggles();
}
}
if (is_array($rule->arg)) {
foreach ($rule->arg as $key => $value) {
$item['arg'][$key] = $value instanceof IControl ? (object) array('control' => $value->getHtmlName()) : $value;
}
} elseif ($rule->arg !== NULL) {
$item['arg'] = $rule->arg instanceof IControl ? (object) array('control' => $rule->arg->getHtmlName()) : $rule->arg;
}
$payload[] = $item;
}
return $payload;
}