Adds a form field to the form.<p>

@param fieldGroup the form field group key
@param formField the form field which should be added
541733
public void addField(String fieldGroup, final I_CmsFormField formField) {

        initializeFormFieldWidget(formField);
        m_fields.put(formField.getId(), formField);
        String modelId = formField.getModelId();
        m_fieldsByModelId.put(modelId, formField);
        formField.getLayoutData().put("group", fieldGroup);
        m_fieldsByGroup.put(fieldGroup, formField);
        //m_widget.addField(formField);

    }
831404
public function edit_field_add($mform) {
        // Create the form field.
        $mform->addElement('editor', $this->inputname, format_string($this->field->name), null, null);
        $mform->setType($this->inputname, PARAM_RAW); // We MUST clean this before display!
    }
1202519
public function push(FormField $field)
    {
        if ($field instanceof Tab || $field instanceof TabSet) {
            $field->setTabSet($this);
        }
        parent::push($field);
    }
855378
public void addOptionalField(String optionalField) {
        if (optionalField == null) {
            return;
        } else if (this.optionalFields == null) {
            this.optionalFields = new ArrayList<String >();
        }
        this.optionalFields.add(optionalField);
    }
599415
public CMAContentType addField(CMAField field) {
    if (fields == null) {
      fields = new ArrayList<CMAField>();
    }

    fields.add(field);
    return this;
  }
1368593
public function add(FormField $field)
    {
        $segments = $this->getSegments($field->getName());

        $target = &$this->fields;
        while ($segments) {
            if (!\is_array($target)) {
                $target = [];
            }
            $path = array_shift($segments);
            if ('' === $path) {
                $target = &$target[];
            } else {
                $target = &$target[$path];
            }
        }
        $target = $field;
    }
331469
public void addKeyField(KeyField keyField)
    { // Get the field with this seq
        m_vKeyFieldList.addElement(keyField);           // Set this key field
        if (m_strKeyName == null)
            m_strKeyName = keyField.getField(DBConstants.FILE_KEY_AREA).getFieldName(false, false);   //x + "Key";  // Default key name
    }
966891
public function addField(FieldTypeInterface $field, SectionInterface $group): FieldsRepositoryInterface
    {
        // We store all fields together
        // as well as per group. On each form,
        // there is a "default" group defined where
        // all fields are attached to. A user can specify
        // a form group to the passed options on the "add"
        // method of the FormBuilder instance.
        $this->fields[$field->getBaseName()] = $field;
        $this->groups[$group->getId()] = $group;

        return $this;
    }
423798
public void addWrittenFields(FieldSet writtenFields) {
		if(this.writtenFields == null) {
			this.writtenFields = new FieldSet(writtenFields);
		} else {
			this.writtenFields.addAll(writtenFields);
		}
	}
102587
protected void addSpecialFields() {

        String firstTab = m_form.getWidget().getDefaultGroup();
        if (m_handler.hasEditableName()) {
            // the root entry name can't be edited
            CmsBasicFormField urlNameField = createUrlNameField();
            m_form.addField(firstTab, urlNameField);
        }
    }
550266
@Nonnull
    public BugInstance addField(FieldVariable field) {
        return addField(field.getClassName(), field.getFieldName(), field.getFieldSig(), field.isStatic());
    }
319343
private function AddUserGroupField()
    {
        $name = 'UserGroup';
        $field = new Select($name, '');

        if ($this->Content()->Exists() && $this->Content()->GetUserGroup()) {
            $field->SetValue($this->Content()->GetUserGroup()->GetID());
        }

        $parentGroup = $this->FindParentGroup();
        $inheritGroupText = $parentGroup ? Trans('Core.ContentForm.UserGroup.Inherit_{0}', $parentGroup->GetName()) :
                Trans('Core.ContentForm.UserGroup.Inherit');

        $field->AddOption('', $inheritGroupText);

        DBSelectUtil::AddUserGroupOptions($field);
        $this->AddField($field, false, Trans('Core.ContentForm.UserGroup'));
    }
94340
protected function addField(SharpFormField $field)
    {
        $this->fields[] = $field;
        $this->formBuilt = false;

        return $this;
    }
1021837
public function updateCMSFields(FieldList $fields)
    {
        // Update Field Objects:
        
        $fields->addFieldToTab(
            'Root.FormOptions',
            CheckboxField::create(
                'EnableSpamGuard',
                $this->owner->fieldLabel('EnableSpamGuard')
            )
        );
    }
143803
public TemplateGenerator addFieldGenerator(String fieldName, FieldGenerator fieldGenerator) {
		multiFieldGenerator.addFieldGenerator(fieldName, fieldGenerator);
		return this;
	}
616789
public <T extends Widget & HasValidators<?>> void add(final T field) {
        fields.put(field, field.validate(false));
        if (field.isAttached()) {
            updateStateAndNotify();
        }
        registrations.put(field, field.addValidationChangedHandler(new ValidationChangedHandler() {
            @Override
            public void onValidationChanged(ValidationChangedEvent event) {
                fields.put(field, event.isValid());
                if (fireEvents) {
                    updateStateAndNotify();
                }
            }
        }));
    }
577501
private void addNestedField(FieldDefinition nestedFieldDef) {
        // Prerequisites
        assert nestedFieldDef != null;
        assert m_type == FieldType.GROUP;
        Utils.require(!m_nestedFieldMap.containsKey(nestedFieldDef.getName()),
                      "Duplicate nested field name: %s", nestedFieldDef.getName());
        
        // Add it to us and point it at us.
        m_nestedFieldMap.put(nestedFieldDef.getName(), nestedFieldDef);
        nestedFieldDef.m_parentField = this;
    }