Form controller - Support for array fields

This commit is contained in:
Emmanuel BENOîT 2016-01-03 11:06:19 +01:00
parent b888e72eef
commit bdc6000634

View file

@ -20,8 +20,12 @@ class Ctrl_Form
continue; continue;
} }
$name = $field->name( );
if ( @substr_compare( $name , '[]' , -2 , 2 ) == 0 ) {
$name = substr( $name , 0 , -2 );
}
try { try {
$value = $this->getParameter( $field->name( ) , $this->form->method( ) ); $value = $this->getParameter( $name , $this->form->method( ) );
} catch ( ParameterException $e ) { } catch ( ParameterException $e ) {
$value = null; $value = null;
} }