Get a rendered metabox field
@param string $name
@param array $field
328138
public function getRenderMetaBoxField($name, $field = null)
    {
        $is_wysiwyg = (
            $field['type'] === 'textarea'
            && array_key_exists('class', $field)
            && preg_match('/wysiwyg/', $field['class'])
        );
        if ($is_wysiwyg) {
            // Showing the editor on the quick add form will break the WordPress admin UI
            // So we'll only allow the WYSIWYG to appear on the edit screen
            if (array_key_exists('tag_ID', $_GET)) {
                $value = (array_key_exists('value', $field)) ? $field['value'] : null;
                ob_start();
                wp_editor($value, $name);
                return ob_get_clean();
            }

            return '<p>Add this record, then edit the record to see the WYSIWYG editor.</p>';
        }

        return parent::getRenderMetaBoxField($name, $field);
    }
853587
public function addFormField(string $name): void
    {
        $options = $this->formOptions['fields'][$name];
        $wrapper = $this->createWrapper();
        $label = '';

        if (isset($options['label']['text'])) {
            $label = $this->createLabel($options['label']['text'], $name);

            unset($options['label']['text']);
        }

        $input = HtmlTag::createElement('input')
            ->set('type', $options['input']['type'] ?? 'text')
            ->set('id', $name)
            ->set('name', $name);

        $caption = '';

        if (isset($options['caption']['text'])) {
            $input->set('aria-describedby', $name . '_caption');
            $caption = $this->createCaption($options['caption']['text'], $name);

            unset($options['caption']['text']);
        }

        $elements = [
            'wrapper' => $wrapper,
            'label'   => $label,
            'input'   => $input,
            'caption' => $caption
        ];

        foreach ($elements as $name => $element) {
            $$name = $this->assignOptionsToElement($options, $name, $element);
        }

        if (in_array($options['input']['type'] ?? 'text', ['checkbox', 'radio', 'file'])) {
            $wrapper->addElement($input);
            $wrapper->addElement($label);
        } else {
            $wrapper->addElement($label);
            $wrapper->addElement($input);
        }

        $wrapper->addElement($caption);

        echo $wrapper;
    }
386762
public function getFieldByName($name)
    {
        foreach ($this->fieldList as $field) {
            if ($field->getFieldName() === $name) {
                return $field;
            }
        }

        return null;
    }
202862
public function getFieldTypeFor($name, $column, $field = null)
    {
        $type = null;
        if ($column instanceof Column) {
            if ($column->getType()) {
                $type = get_class($column->getType());
            }
            $column = $column->getName();
        }
        if ($field !== null) {
            if (isset($this->contenttypes[$name]) && isset($this->contenttypes[$name]['fields'][$column]['fields'][$field])) {
                $type = $this->contenttypes[$name]['fields'][$column]['fields'][$field]['type'];
            }
        } elseif (isset($this->contenttypes[$name]) && isset($this->contenttypes[$name]['fields'][$column])) {
            $type = $this->contenttypes[$name]['fields'][$column]['type'];
        }

        if ($column === 'slug') {
            $type = 'slug';
        }

        if ($type === 'select' && isset($this->contenttypes[$name]['fields'][$column]['multiple']) && $this->contenttypes[$name]['fields'][$column]['multiple'] === true) {
            $type = 'selectmultiple';
        }

        if ($type && isset($this->typemap[$type])) {
            $type = $this->typemap[$type];
        } else {
            $type = $this->typemap['text'];
        }

        return $type;
    }
679656
Field getField(String name)
    {       
        FieldInfo info=getFieldInfo(name);
        return getField(info,true);
    }
1196129
def get_field(name)
      @fields ||= {}
      field = fields[name]
      raise Tripod::Errors::FieldNotPresent.new unless field
      field
    end
1010340
public function getField($name)
    {
        if (isset($this->typeClasses[$name])) {
            return $this->inject(new $this->typeClasses[$name]);
        } else {
            throw new ParserException('Unknown field type: '.$name);
        }
    }
481243
public function getDecodedValue($name)
    {
        $value = null;

        if (isset($this->values[$name])) {
            $fieldtype = $this->fieldType($name);
            $fieldinfo = $this->fieldInfo($name);
            $allowtwig = !empty($fieldinfo['allowtwig']);

            switch ($fieldtype) {
                case 'markdown':
                    // Deprecated: This should be moved to a render function in
                    // Bolt\Storage\Field\Type\MarkdownType eventually.
                    $value = $this->app['markdown']->text($this->values[$name]);
                    $value = $this->preParse($value, $allowtwig);
                    $value = new Markup($value, 'UTF-8');

                    break;

                case 'html':
                case 'text':
                case 'textarea':
                    $value = $this->preParse($this->values[$name], $allowtwig);
                    $value = new Markup($value, 'UTF-8');

                    break;

                case 'imagelist':
                case 'filelist':
                    if (is_string($this->values[$name])) {
                        // Parse the field as JSON, return the array
                        $value = Json::parse($this->values[$name]);
                    } else {
                        // Already an array, do nothing.
                        $value = $this->values[$name];
                    }
                    break;

                case 'image':
                    if (is_array($this->values[$name]) && isset($this->values[$name]['file'])) {
                        $value = $this->values[$name]['file'];
                    } else {
                        $value = $this->values[$name];
                    }
                    break;

                default:
                    $value = $this->values[$name];
                    break;
            }
        }

        return $value;
    }
1125306
public function getField($name)
    {
        if ('pk' === $name) {
            $name = $this->getPrimaryKeyName();
        }

        $name = $this->getMappingName($name);

        if (isset($this->fields[$name])) {
            $field = $this->fields[$name];
            $field->cleanValue();

            return $field;
        }
    }
1085879
public function get_element_by_name($name, $compareMode=self::SLUG_COMPARE)
    {
        if (null === $this->cache_name_id) {
            $this->cache_name_id = [];

            foreach ($this->elements as $id => $meta) {
                $this->cache_name_id[$meta->get_name()] = $id;
            }
        }

        if($compareMode == self::SLUG_COMPARE) {
            $name = databox_field::generateName($name, $this->unicode);
        }

        return isset($this->cache_name_id[$name])
            ? $this->elements[$this->cache_name_id[$name]]
            : null;
    }
1254701
public function getFieldsByName($name)
    {
        $result = [];

        foreach ($this->fields as $field) {
            if ($field->getName() == $name) {
                $result[] = $field;
            }
        }

        return $result;
    }
533847
public function retrieveRule($field, $name = null)
    {
        $key = $this->generateKey(self::DYNAMIC_RULE_KEY, $field);
        $allRules = self::storage()->get($key, []);
        if (empty($name)) {
            return $allRules;
        }

        return isset($allRules[$name]) ? $allRules[$name] : null;
    }
978437
public function getFieldsByName( $name )
	{
		$name	= strtolower( $name );
		if( isset( $this->fields[$name] ) )
			return $this->fields[$name];
		return array();
	}
822136
public function addFieldFromConfig($name, $field)
    {
        $this->addField(Fields::create($name, $field));
        return $this;
    }
1304806
protected function buildFormOptions($name, array $field, $data = null)
    {
        // Allow sub options structure (collection case)
        if (isset($field['options']['constraints'])) {
            $field['options']['options'] = $this->buildFormOptions('', $field['options']);
        }

        $constraints = array();
        foreach ($field['constraints'] as $constraint) {
            $constraints[] = $this->buildConstraint($constraint);
        }

        $field['options']['constraints'] = $constraints;

        if (null !== $data && isset($data[$name])) {
            $field['options']['data'] = $data[$name];
        }

        return $field['options'];
    }
23554
public function input($name, $options = array())
    {
        $options += array(
            "type"  => "text",
            "id"    => $this->id($name),
            "name"  => $this->name($name),
            "error" => true,
            "class" => "",
            "value" => "",
            "label" => null
        );

        $currentValue = $this->getCurrentValue($options['name']);

        $errorHtml = "";
        $fieldHasErrors = false;

        if (!is_null($this->associatedEntity)) {
            // Checkboxes may be posted has data[name][0] and therefore
            // we need to remove it to get the absolute field name.
            $validationName = $options["type"] === "checkbox" ?
                preg_replace('/\[\d+\]$/', '', $name) :
                $name;

            if ($this->associatedEntity->hasErrors($validationName)) {
                if ((bool)$options['error']) {
                    $errorHtml = $this->generateInlineErrors($validationName);
                }
                $fieldHasErrors = true;
                $options['class'] .= " error ";
            }
        }
        unset($options["error"]);

        $label = "";
        if (!is_null($options['label'])) {
            $labelOptions = array(
                "for"    => $options["id"],
                "class" => $fieldHasErrors ? "error" : "",
                "label" => $options["label"],
            );

            $label .= $this->label($options['name'], $labelOptions);
        }
        unset($options['label']);

        switch (strtolower($options['type'])) {
            case "textarea":
                return $label . "\n" . $this->generateTextarea($options, $currentValue) . $errorHtml . "\n";
            case "select":
                return $label . "\n" . $this->generateSelect($options, $currentValue) . $errorHtml . "\n";
            case "radio":
                return $this->generateRadio($options, $currentValue) . $errorHtml . "\n" . $label . "\n";
            case "checkbox":
                return $this->generateCheckbox($options, $currentValue) . $errorHtml . "\n" . $label . "\n";
            case "hidden":
                return $label . "\n" . $this->generateHidden($options, $currentValue) . $errorHtml . "\n";
            default:
                return $label . "\n" . $this->generateTextinput($options, $currentValue) . $errorHtml . "\n";
        }
    }
481399
protected function renderFieldset(array $field)
    {
        $output = '';
        $output .= $this->fieldsetBegin($field);
        $output .= $this->renderFields($field['fields']);
        $output .= $this->fieldsetEnd($field);
        return $output;
    }