Back to FormBehaviorTrait class

Method preprocessForm

protected void
preprocessForm
(\Joomla\CMS\Form\Form $form, mixed $data, mixed $group = 'content')
Method to allow derived classes to preprocess the form.
Parameters
  • \Joomla\CMS\Form\Form $form A Form object.
  • mixed $data The data expected for the form.
  • string $group The name of the plugin group to import (defaults to "content").
Returns
  • void
Since
  • 4.0.0
-
  • \Joomla\CMS\Form\FormField
  • \Exception if there is an error in the form event.

Method preprocessForm - Source code

/**
 * Method to allow derived classes to preprocess the form.
 *
 * @param   Form    $form   A Form object.
 * @param   mixed   $data   The data expected for the form.
 * @param   string  $group  The name of the plugin group to import (defaults to "content").
 *
 * @return  void
 *
 * @see     FormField
 * @since   4.0.0
 * @throws  \Exception if there is an error in the form event.
 */
protected function preprocessForm(Form $form, $data, $group = 'content')
{
    // Import the appropriate plugin group.
    PluginHelper::importPlugin($group);
    // Trigger the form preparation event.
    Factory::getApplication()->triggerEvent('onContentPrepareForm', array($form, $data));
}