Your cart is empty!
Build Parameters Form
public function onBuildParametersForm{$driver}(array &$form, mixed $handler) : void
Fires while loading the form fields of the specified export driver.
Description
Trigger hook to allow the plugins to manipulate the parameters form used by the export driver.
The dynamic portion of the hook name, $driver
, refers to the name of the export driver calling the hook. This means that, for example, the CSV export driver will trigger an hook called onBuildParametersFormCSV
.
Parameters
- &$form
-
(array) An associative array containing all the form fields of the export driver.
- $handler
-
(VAPOrderExportDriver) The instance used to export the records.
Return Value
None.
Example
/**
* Trigger hook to allow the plugins to manipulate the parameters
* form used by this export driver.
*
* @param array &$form A configuration array.
* @param mixed $handler The export driver instance.
*
* @return void
*/
public function onBuildParametersFormCSV(&$form, $handler)
{
// overwrite type of "delimiter" and "enclosure" fields, by changing
// them from "select" to "text" fields
$form['delimiter']['type'] = 'text';
$form['enclosure']['type'] = 'text';
// add a new field
$form['foo'] = [
'type' => 'select',
'label' => 'Foo',
'default' => 1,
'options' => [
1 => JText::_('JYES'),
0 => JText::_('JNO'),
],
];
}
Changelog
Version | Description |
---|---|
1.7 | Introduced. |
Last Update: 2021-10-08 09:55
Helpful?