Back to Joomla project (class list)

Class FormBehaviorTrait - list of methods

Trait which supports form behavior.
Package: Joomla\CMS\MVC\Model
Copyright: (C) 2019 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE
Located at: Joomla/MVC/Model/FormBehaviorTrait.php
Project: Joomla

Method Summary

protected \Joomla\CMS\Form\Form
(mixed $name, mixed $source = null, mixed $options = array(), mixed $clear = false, mixed $xpath = null)

Method to get a form object.
Parameters
  • string $name The name of the form.
  • string $source The form source. Can be XML string if file flag is set to false.
  • array $options Optional array of options for the form creation.
  • bool $clear Optional argument to force load a new form.
  • string $xpath An optional xpath to search for the fields.
Returns
  • \Joomla\CMS\Form\Form
Since
  • 4.0.0
-
  • \Joomla\CMS\Form\Form
  • \Exception
Show source code of this method: loadForm Source Code

protected array
()

Method to get the data that should be injected in the form.
Returns
  • array The default data is an empty array.
Since
  • 4.0.0
Show source code of this method: loadFormData Source Code

protected void
(mixed $context, mixed &$data, mixed $group = 'content')

Method to allow derived classes to preprocess the data.
Parameters
  • string $context The context identifier.
  • mixed & $data The data to be processed. It gets altered directly.
  • string $group The name of the plugin group to import (defaults to "content").
Returns
  • void
Since
  • 4.0.0
Show source code of this method: preprocessData Source Code

protected void
(\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.
Show source code of this method: preprocessForm Source Code

public \Joomla\CMS\Form\FormFactoryInterface
()

Get the FormFactoryInterface.
Returns
  • \Joomla\CMS\Form\FormFactoryInterface
Since
  • 4.0.0
-
  • \UnexpectedValueException May be thrown if the FormFactory has not been set.
Show source code of this method: getFormFactory Source Code

Properties Summary

protected \Joomla\CMS\Form\Form[]
$_forms
Array of form objects.
Since
  • 4.0.0

Tags Summary

Since
4.0.0