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

Support array form value by Validator #59

Closed
tanakahisateru opened this issue Jun 8, 2012 · 1 comment
Closed

Support array form value by Validator #59

tanakahisateru opened this issue Jun 8, 2012 · 1 comment
Milestone

Comments

@tanakahisateru
Copy link
Owner

Pinoco's validator framework can't deal array form value. But there are even enough amount of them like multiple check-box or such as.

<label><input name="opts[]" type="checkbox" value="opt1"/>GPL</label>
<label><input name="opts[]" type="checkbox" value="opt2"/>BSD</label>
<label><input name="opts[]" type="checkbox" value="opt3"/>MIT</label>
<label><input name="opts[]" type="checkbox" value="opt4"/>Apache</label>

My idea:

<?php
$validator->check('opts')->is('array')->all('in opt1,opt3,opt3,opt4');
<?php
$validator->check('opts')->is('array')->any('in opt1,opt3,opt3,opt4');
@tanakahisateru
Copy link
Owner Author

Changed sample code above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant