Hi, and thanks for your reply.
I find it odd though that the values that I supply to ZFI aren't
available to me unless I validate them. Since I use ZFI so I don't have
to mess around with the $_POST array. Using additional filter classes
just to get filtered values seems messy, especially when you have lots
of values.
Oh well, thanks for clearing that up :-).
Bjarte
Joshua Ross wrote:
I believe Zend_Filter_Input::getUnknown() would return the raw value
but it will not be filtered. I think that is contrary to the idea of
ZFI where a value must first be valid before it is filtered and
returned. If you just need to just filter the value then
instantiating an instance of that particular filter is probably what
you want.
Josh
"Bjarte Kalstveit Vebjørnsen" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hi all.
I am having troubles with the new Zend_Filter_Input.
It is quite possible that I've missed something obvious, but here is
my problem.
<?php
require_once 'Zend/Filter/Input.php';
$values = array(
'test' => '22',
'test2' => '22'
);
$filters = array('*'=> 'Digits');
$validators = array('test2' => 'Digits');
$input = new Zend_Filter_Input($filters, $validators, $values);
echo "<pre>";
var_dump($input->test);
var_dump($input->test2);
echo "</pre>";
?>
This gives me:
NULL
string(2) "22"
How can I access the filtered value of test, without adding a
validator for it?
(If I add test to the list of validators, it works).
Best regards,
Bjarte