⇦  Back to FormField classMethod setForm
public \Joomla\CMS\Form\FormField
setForm
(\Joomla\CMS\Form\Form $form)
Method to attach a Form object to the field.
Parameters
- \Joomla\CMS\Form\Form  $form  The Form object to attach to the form field.
 
Returns
- \Joomla\CMS\Form\FormField The form field object so that the method can be used in a chain.
 
Since
Method setForm - Source code
/**
 * Method to attach a Form object to the field.
 *
 * @param   Form  $form  The Form object to attach to the form field.
 *
 * @return  FormField  The form field object so that the method can be used in a chain.
 *
 * @since   1.7.0
 */
public function setForm(Form $form)
{
    $this->form = $form;
    $this->formControl = $form->getFormControl();
    return $this;
}