I am having another issue using the Zend_Filter_Input fields metacommand.
When using the fields meta command if the rule name is different than the
fields metacommand then to access the value via magic accessors you should
use the rule name not the fields name, correct? That is what is implied in
the documentation.
For example, if you have the following Zend_Filter_Input:
$validators = array('myfield' => array('fields' => 'somefield'));
$input = new Zend_Filter_Input(array(), $validators,
$this->getRequest()->getParams());
Then you should be able to use the rule name 'myfield' as a magic accessor
to retrieve the 'somefield' value:
echo $input->myfield;
This returns null. The 'somefield' value is only available via magic
accessor using 'somefield' as the rule name:
echo $input->somefield;
The problem is that I am not entirely sure that the value accessed using
$input->somefield has actually been properly validated or filters(beyond
standard htmlentities). I tested this using the fields command with a
string value and an array of string values, both return null when attempting
to access the value using the rule name.
I believe this is a bug however I am surprised no-one else has ran into this
problem. Is there something I missed in the documentation or am I doing
something wrong here? If not, shall I add this to the issue tracker?
Thanks,
-Joshua-