I'm trying to implode an array by using the Zend_Filter_Interface.
Here's my simplified test case.
class My_Filter_Implode implements Zend_Filter_Interface
{
public function filter($value)
{
return implode(',', $value);
}
}
The input will be an array.
$rawInput = array('items' => array('a', 'b', 'c'));
$validators = array(
'items' => array()
)
$filters = array(
'items' => 'Implode'
);
$filterInput = new Zend_Filter_Input($filters, $validators, $rawInput, $options);
I would like the filter to transform array('a', 'b', 'c') to a string 'a,b,c'. It is instead applying the filter to each item in the array. How can the value passed to filter() be passed as an array?