Add field into current layout. If no layout, create one. If no model, create blank one.

@param string|null              $name
@param array|string|object|null $decorator
@param array|string|object|null $field

@return FormField\Generic
964878
public function addField($name, $decorator = null, $field = null)
    {
        if (!$this->model) {
            $this->model = new \atk4\ui\misc\ProxyModel();
        }

        return $this->layout->addField($name, $decorator, $field);
    }
590750
public function importField($field, $field_name = null)
    {
        $field = $this->model->hasElement($field);
        /** @type \atk4\data\Field $field */

        if (!$field || !$field->isEditable() || $field->isHidden()) {
            return;
        }

        if ($field_name === null) {
            $field_name = $this->_unique($this->owner->elements, $field->short_name);
        }
        $this->field_associations[$field_name] = $field;

        $field_type = $this->getFieldType($field);
        $field_caption = isset($field->ui['caption']) ? $field->ui['caption'] : null;

        // add form field
        $form_field = $this->owner->addField($field_type, $field_name, $field_caption);
        $form_field->set($field->get());

        // set model for hasOne field
        if ($ref_field = $this->model->hasRef($field->short_name)) {
            $form_field->setModel($ref_field->getModel());
        }

        // set model for enum field
        if (isset($field->enum)) {

            $list = isset($field->ui['valueList'])
                ? $field->ui['valueList']
                : array_combine($field->enum, $field->enum);

            if ($form_field instanceof Form_Field_Checkbox) {
                $list = array_reverse($list);
            }


            $form_field->setValueList($list);
        }

        // field value is mandatory
        if ($field->mandatory) {
            $form_field->validateNotNULL($field->mandatory);
        }

        // form field placeholder
        $placeholder = isset($field->ui['placeholder']) ? $field->ui['placeholder'] : /*$field->emptyText() ?:*/ null;
        if ($placeholder) {
            $form_field->setAttr('placeholder', $placeholder);
        }

        // form field hint
        if (isset($field->ui['hint'])) {
            $form_field->setFieldHint($field->ui['hint']);
        }

        // set empty text option for dropdown type form fields if model field is not mandatory
        if ($form_field instanceof Form_Field_ValueList && !$field->mandatory) {
            /** @type string $text */
            //$text = $field->emptyText();
            //$form_field->setEmptyText($text);
            $form_field->setEmptyText('- no value -');
        }

        return $form_field;
    }
538402
public function register($name, $fieldClass = null)
    {
        if (new $fieldClass instanceof FormFieldInterface) {
            $this->registeredFields[$name] = $fieldClass;
        }
    }
949196
public static function create(string $name, bool $emptyToNull = false): DenormalizationFieldMappingBuilderInterface
    {
        $self = new self($name);
        $self->fieldDenormalizer = new FieldDenormalizer(new PropertyAccessor($name), $emptyToNull);

        return $self;
    }
38568
public function field($name = null, $flatten = false)
	{
		return $this->fieldset->field($name, $flatten);
	}
251979
function(name, form) {
    //schemaDecorator is alias for whatever is set as default
    if (name === 'sfDecorator') {
      name = defaultDecorator;
    }

    var decorator = decorators[name];
    if (decorator[form.type]) {
      return decorator[form.type].template;
    }

    //try default
    return decorator['default'].template;
  }
972932
public function withFieldAnnotation($fieldName, $name, $value)
    {
        $copy = clone $this;

        $copy->annotations = $this->annotations->update(
            $fieldName,
            function (ArrayMap $fieldAnnotations) use ($name, $value) {
                return $fieldAnnotations->insert($name, $value);
            },
            ArrayMap::zero()
        );

        return $copy;
    }
4590
public function replaceField($name, $field)
    {
        $index = $this->getFieldIndex($name);
        $this->removeFieldAtIndex($index);
        $this->insertFields($field, $index);
    }
279954
public function getField($name)
		{
			return isset($this->fields[$name])
				? $this->fields[$name]
				: null;
		}
354303
public EmbedBuilder addInlineField(String name, String value) {
        delegate.addField(name, value, true);
        return this;
    }
1236164
def add_field(self, name, default=None, required=False, error=None):
        
        if name is None:
            return
        self.field_arguments.append(dict(
            name=name,
            default=default,
            required=required,
            error=error))
1357283
public function addField($name, $alias = null)
    {
        $field = $this->add($this->field_class, $name);
        /** @type Field_Base $field */
        $field = $field->actual($alias);

        /** @type Field_Base $field */
        return $field;
    }
1053289
public function getField($name)
    {
        return $this->fields->has($name) ? $this->fields[$name] : null;
    }
914078
public function addField($field, $value=null) {
        $this->fields[] = $field;
        if ($value != null) $this->set($field, $value);
    }
819200
public function button($value, $name = null) 
	{
		Argument::i()
			->test(1, 'string')
			->test(2, 'string', 'null')
			->test(3, 'bool');
		
		$field = Button::i()->setValue($value);
		
		if(!is_null($name)) {
			$field->setName($name);
		}
		
		return $field;
	}
1038190
def add_field(self, field):
        """"""
        self.remove_field(field.name)
        self._fields[field.name] = field

        if field.default is not None:
            if six.callable(field.default):
                self._default_callables[field.key] = field.default
            else:
                self._defaults[field.key] = field.default
328199
function add_field($name,$value){
		LogMaster::log("adding field: ".$name.", with value: ".$value);
		$this->data[$name]=$value;
		$this->addf[]=$name;
	}