简体   繁体   中英

Zend_Filter_Input - get filtered values to Array

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.

$data = $data->getEscaped();

去这里看看:http: //zendframework.com/manual/en/zend.filter.input.html了解更多信息

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM