Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Formo::add_rule() to use a syntax similar to Validation::rule(). #195

Merged
merged 1 commit into from Apr 28, 2013

Conversation

shadlaws
Copy link
Collaborator

This allows a syntax similar to Validation::rule() and Formo::remove_rule() as

$field->add_rule($rule);
$field->add_rule($rule, $params);

or a syntax similar to Validation::rules() and Formo::add_rules() as

$field->add_rule(array($rule));
$field->add_rule(array($rule, $params));

Not only does this make our implementation code a little cleaner (working on updating Gallery to Kohana 3.3 at https://github.com/gallery/gallery3/tree/kohana_3), but it also makes it easier to extend add_rule(). FWIW, I'm extending add_rule() to allow inline error message definitions (inline as opposed to in message files, that is)...

Thanks!

@bmidget
Copy link
Owner

bmidget commented Apr 28, 2013

Looks good. I've added you as a Formo collaborator. Please make sure you match Formo style and quality of code and update docs as well with changes.

@shadlaws
Copy link
Collaborator Author

Thanks much - I appreciate it! And thanks also on all the work you've put into Formo!

shadlaws added a commit that referenced this pull request Apr 28, 2013
Allow Formo::add_rule() to use a syntax similar to Validation::rule().
@shadlaws shadlaws merged commit e0e8aa3 into bmidget:master Apr 28, 2013
@shadlaws shadlaws deleted the revise_add_rule_syntax branch April 28, 2013 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants