Allows to set various hidden fields from a single method call;
can be used with:
$form->addHiddenFields( $context->getRequest()->getValues( /* field list */ ) );
Change-Id: I864584e5889297bb680808163f48795bab8f7afb
return $this;
}
+ /**
+ * Add an array of hidden fields to the output
+ *
+ * @since 1.22
+ * @param array $fields Associative array of fields to add;
+ * mapping names to their values
+ * @return HTMLForm $this for chaining calls
+ */
+ public function addHiddenFields( array $fields ) {
+ foreach ( $fields as $name => $value ) {
+ $this->mHiddenFields[] = array( $value, array( 'name' => $name ) );
+ }
+ return $this;
+ }
+
/**
* Add a button to the form
* @param string $name field name.