0

I try to extract all filtered fields from Zend_Filter_Input in order to add extra fields and pass it to the model to insert or update, however I getting lost with extract piece:

$filters = Array(   '*'         => Array( 'StripTags', 'StringTrim' ) );

$data =  new Zend_Filter_Input( $filters, Array( ), $this->_request->getParams( ) );
// line below does't work what I should use instead ?
$data = $data->toArray( );

foreach ( $extra_fields as $key => $value ) {
    $data [ $key ] = $value;
} // FOREACH

I just looking to get all filtered fields as array of value pairs.

1 Answer 1

4
$data = $data->getEscaped();

Go and have a look here : http://zendframework.com/manual/en/zend.filter.input.html for more informations

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.