本文整理匯總了PHP中FormControl::notifyRule方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormControl::notifyRule方法的具體用法?PHP FormControl::notifyRule怎麽用?PHP FormControl::notifyRule使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FormControl
的用法示例。
在下文中一共展示了FormControl::notifyRule方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: notifyRule
/**
* New rule or condition notification callback.
* @param Rule
* @return void
*/
public function notifyRule(Rule $rule)
{
if ($rule->type === Rule::VALIDATOR && is_string($rule->operation) && strcasecmp($rule->operation, ':mimeType') === 0) {
$this->control->accept = $rule->arg;
}
parent::notifyRule($rule);
}
示例2: notifyRule
public function notifyRule(Rule $rule)
{
if (is_string($rule->operation) && strcasecmp($rule->operation, ':float') === 0) {
$this->addFilter(array(__CLASS__, 'filterFloat'));
}
parent::notifyRule($rule);
}
示例3: notifyRule
public function notifyRule(Rule $rule)
{
if ($rule->type === Rule::VALIDATOR && strcasecmp($rule->operation, ':float') === 0) {
$this->addFilter(array(__CLASS__, 'filterFloat'));
}
parent::notifyRule($rule);
}
示例4: notifyRule
public function notifyRule(Rule $rule)
{
if (is_string($rule->operation) && !$rule->isNegative) {
if (strcasecmp($rule->operation, ':float') === 0) {
$this->addFilter(callback(__CLASS__, 'filterFloat'));
} elseif (strcasecmp($rule->operation, ':length') === 0) {
$this->control->maxlength = is_array($rule->arg) ? $rule->arg[1] : $rule->arg;
} elseif (strcasecmp($rule->operation, ':maxLength') === 0) {
$this->control->maxlength = $rule->arg;
}
}
parent::notifyRule($rule);
}