cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[NFR] Applying a filter to array

Open lobostome opened this issue 13 years ago • 3 comments

There is a situation in which we may need to apply one or more filters to an array. A common use case will be a submission of a form with checkboxes.

<input type="checkbox" name="emails[]" value="[email protected]">
<input type="checkbox" name="emails[]" value="[email protected]"> 
<input type="checkbox" name="emails[]" value="[email protected]"> 

Currently, it seems that the only way to sanitize the $_POST['emails'] is by looping and applying a filter to each value of the array. It will be much more convenient if that could be done with one line of code as is done with strings.

$email = $request->getPost("emails", "email");

lobostome avatar Jan 11 '13 11:01 lobostome

+1

mrspartak avatar Jan 11 '13 12:01 mrspartak

It's a good feature.

applejohnny avatar Jan 16 '13 05:01 applejohnny

This is now supported in 0.9.0

ghost avatar Jan 23 '13 20:01 ghost