本文整理汇总了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);
}