Returns the submitted value of the $field that should be used when displaying the form.

The array feature comes in handy when you want to save the values to your database.

@param string|array $field

@return mixed
163812
public function value($field)
    {
        if (is_array($field)) {
            $values = array();
            foreach ($field as $key => $value) {
                $values[$key] = $this->value($value);
            }

            return $values;
        }

        return ($this->submitted && isset($this->values[$field])) ? $this->values[$field] : null;
    }
967051
public function getField($field)
	{
		$result = $this->client->get("fields/{$field}");
		return $result ? new Resources\Field($this, $result) : null;
	}
294708
public function fieldPosition($field)
    {
        if (is_string($field)) {
            $field = $this->fieldByName($field);
        }
        if (!$field) {
            return false;
        }

        $i = 0;
        foreach ($this->children as $child) {
            /** @var FormField $child */
            if ($child->getName() == $field->getName()) {
                return $i;
            }
            $i++;
        }

        return false;
    }
1155265
protected function getFieldValue($field)
    {
        if (is_string($field)) {
            if (!isset($this->allFields[$field])) {
                throw new ApplicationException(Lang::get(
                    'backend::lang.form.missing_definition',
                    compact('field')
                ));
            }

            $field = $this->allFields[$field];
        }

        $defaultValue = !$this->model->exists
            ? $field->getDefaultFromData($this->data)
            : null;

        return $field->getValueFromData(
            $this->data, 
            is_string($defaultValue) ? trans($defaultValue) : $defaultValue
        );
    }
1136254
public function getFieldType($field)
    {
        // default form field type
        $type = 'Line';

        // try to find associated form field type
        if (isset($this->type_associations[$field->type()])) {
            $type = $this->type_associations[$field->type()];
        }
        if ($field instanceof Field_Reference) {
            $type = 'DropDown';
        }

        // if form field type explicitly set in model
        if ($field->display()) {
            $tmp = $field->display();
            if (is_array($tmp)) {
                $tmp = $tmp['form'];
            }
            if ($tmp) {
                $type = $tmp;
            }
        }

        return $type;
    }
1022667
public function getField($field)
    {
        return isset($this->data[$field]) ? $this->data[$field] : null;
    }
486851
public function get_field_raw( $field ) {
		if ( array_key_exists( $field, $this->prop( 'fields' ) ) ) {
			return $this->prop( 'fields' )[ $field ];
		}

		return null;
	}
1313972
public function resolveForField($field)
    {
        if (! is_null($element = $this->findById($field))) {
            return $element;
        }

        return $this->firstOrFail([
            $field, "input[name='{$field}']", "textarea[name='{$field}']",
            "select[name='{$field}']", "button[name='{$field}']",
        ]);
    }
532171
public function getOptionValue($field)
    {
        $postType = getPostType($this->getTable());
        if(!$postType) {
            throw new \Exception("Post type ".$this->getTable()."' does not exists!");
        }
        return $postType->getMultioptionFieldValue($field, $this->$field);
    }
1032848
public function get($field)
    {
        if ($this->definition->getField($field, 'value') !== null) {
            return $this->definition->getField($field, 'value');
        }

        if (!array_key_exists($field, $this->entity)) {
            return null;
        }

        $type  = $this->definition->getType($field);
        $value = $this->toType($this->entity[$field], $type);
        return $value;
    }
1140465
public function getFieldData($field)
    {
        // $this->data could only be array or object, which has been checked by $this->setData
        if ((is_array($this->data) && array_key_exists($field, $this->data))
            || ($this->data instanceof \ArrayAccess && $this->data->offsetExists($field))
        ) {
            return $this->data[$field];
        } elseif (isset($this->data->$field)) {
            return $this->data->$field;
        } elseif (method_exists($this->data, 'get' . $field)) {
            return $this->data->{'get' . $field}();
        } else {
            return null;
        }
    }
448929
public function getValFormatted($field)
    {
        if ($this->validate($field)) {
            $value = $field->valRaw();
            $dateArray = $this->getDateArray($value);
            return \sprintf('%04d-%02d-%02d', $dateArray['year'], $dateArray['mon'], $dateArray['mday']);
        }
        return null;
    }
713107
public function getError($field) {
        if(array_key_exists($field, $this->errors)) {
            return $this->errors[$field];
        }
        return null;
    }
248300
public function setField($field,$value='') {
        if(is_array($field)) {
            $data           =   $field;
        }else{
            $data[$field]   =   $value;
        }
        return $this->save($data);
    }
1262743
public function getValue($field)
  {
    $v = $this->getValues();

    return isset($v[$field]) ? $v[$field] : false;
  }
1135244
protected function getNestedValue($field)
	{
		$field = preg_split('(__([0-9]+)__)', substr($field, 11), -1, PREG_SPLIT_DELIM_CAPTURE);

		if (!isset($this->data[$field[0]])) {
			return null;
		}

		$data =& $this->data[$field[0]];

		for ($i = 0; isset($field[$i]); $i += 2) {

			if (isset($field[$i + 1])) {
				if (!isset($data[$field[$i + 1]])) {
					return null;
				}
				if (!isset($data[$field[$i + 1]][$field[$i + 2]])) {
					return null;
				}
				$data =& $data[$field[$i + 1]][$field[$i + 2]];
			}
			else {
				return $data;
			}

		}
	}
1143073
public function getFieldValue($field, $data = null)
    {
        if ($data !== null && isset($data[$field])) {
            return $data[$field];
        }
        if (isset($this->{$field})) {
            return $this->{$field};
        }
        return null;
    }