-
Notifications
You must be signed in to change notification settings - Fork 772
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
Feature Request: Truthy Validation Rule #262
Comments
You can use To be honest I don't see much usage for |
I can see the reasoning behind this. The FILTER_VALIDATE_BOOLEAN considers even "on" and "yes" as valid booleanish. Perhaps we could provide a proxy for all FILTER_VALIDATE_ validators. That could grasp a lot of use cases. |
I'm building a REST API using SLIM. I need to validate If I do: I get: _error: ""true" must be a boolean",_ With /path/to/list?is_active=false If I do your example: I get: TRUE (I expect false) And so on. I agree with @alganet Thank you for your consideration |
We already have Both in insensitive case:
What you think? |
I like it. 👍 |
I will send a PR tomorrow! 😄 |
Hi,
Is it possible to create a "Truthy" validator?
That is, for my purposes, the following are all OK: true, "true", "TRUE", "True", 1, "1"
The code would look like this:
Thank you for your consideration.
The text was updated successfully, but these errors were encountered: