Return a text type instance.

@param string $name
@param array  $options

@return FieldTypeInterface
968054
public function text(string $name, array $options = []): FieldTypeInterface
    {
        return (new TextType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
325278
public function make($name, $options = [])
    {
        if (!$name || !$this->exists($name)) {
            return null;
        }

        return $name($options);
    }
812533
public function getMenu($name = null, $options = array())
    {
        if (!isset($name))
        {
            $app = JFactory::getApplication();
            $name = $app->getName();
        }

        try
        {
            if (!class_exists('JMenu' . ucfirst($name))) {
                jimport('cms.menu.'.strtolower($name));
            }

            $menu = JMenu::getInstance($name, $options);
        }
        catch (Exception $e) {
            return null;
        }

        return $menu;
    }
838882
public function text($name, $options = [])
    {
        $requiredClass = (isset($options['required']) && $options['required'] == true) ? 'required ' : '';
        $hasError = $this->errorBag->has($this->formatArrayName($name));
        $hasErrorClass = $hasError ? 'has-error' : '';
        $htmlForm = '<div class="form-group '.$requiredClass.$hasErrorClass.'">';

        $htmlForm .= $this->setFormFieldLabel($name, $options);

        if (isset($options['addon'])) {
            $htmlForm .= '<div class="input-group">';
        }
        if (isset($options['addon']['before'])) {
            $htmlForm .= '<span class="input-group-prepend"><div class="input-group-text">'.$options['addon']['before'].'</div></span>';
        }

        $type = isset($options['type']) ? $options['type'] : 'text';
        $value = isset($options['value']) ? $options['value'] : null;
        $fieldAttributes = $this->getFieldAttributes($options);

        if (isset($options['placeholder'])) {
            $fieldAttributes += ['placeholder' => $options['placeholder']];
        }

        if ($hasError) {
            $fieldAttributes['class'] .= ' is-invalid';
        }

        $htmlForm .= FormFacade::input($type, $name, $value, $fieldAttributes);

        if (isset($options['addon']['after'])) {
            $htmlForm .= '<span class="input-group-append"><div class="input-group-text">'.$options['addon']['after'].'</div></span>';
        }
        if (isset($options['addon'])) {
            $htmlForm .= '</div>';
        }

        $htmlForm .= $this->getInfoTextLine($options);

        $htmlForm .= $this->errorBag->first($this->formatArrayName($name), '<span class="invalid-feedback" role="alert">:message</span>');

        $htmlForm .= '</div>';

        return $htmlForm;
    }
312213
public static function email($name, $value = null, array $options = [])
    {
        self::exclure($options);

        return self::input('email', $name, $value, $options);
    }
225518
public function getInputType($type, $name)
    {
        if (in_array($name, $this->specials)) {
            return $name;
        }

        if (array_key_exists($type, $this->types)) {
            return $this->types[$type];
        }

        return in_array($type, $this->inputs) ? $type : 'text';
    }
1153871
protected function newField($name, array $options): FieldConfig
    {
        if (OrderField::isOrder($name)) {
            return new OrderField($name, $this, $options);
        }

        return new SearchField($name, $this, $options);
    }
587380
public function add($name, $type = null, array $options = array(), array $fieldDescriptionOptions = array())
    {
        if (null === $this->formMapper) {
            throw new LogicException('No FormMapper to add fields to, please make sure you start with AdminUtil->map');
        }
        $this->formMapper->add($name, $type, $options, $fieldDescriptionOptions);
        if ($this->addHelp) {
            $this->formMapper->setHelps([$name => 'help' . (null !== $this->helpPrefix ? sprintf('.%s', $this->helpPrefix) : '') . '.' . $name]);
        }
        return $this;
    }
1332566
private function getDataType($name)
    {
        if (!$this->type) {
            $this->type = $this->optionRegistry->getDataType($name);
        }

        return $this->type;
    }
199183
private function mkstr($name, $type = 'string', $options = array())
    {
        $result = "  define('$name', ";
        $quot = "'";
        $value = isset($_POST[$name]) ? $_POST[$name] : null;

        if (isset($options['nobr']) && $options['nobr'])
        {
            $value = str_replace(array("\n", "\r"), ' ', $value);
        }

        if (isset($options['savebr']) && $options['savebr'])
        {
            $value = addcslashes($value, "\n\r\"");
            $quot = '"';
        }

        switch ($type)
        {
            case 'string':
                $value = str_replace(
                    array('\\', $quot),
                    array('\\\\', '\\' . $quot),
                    $value
                );
                $value = $quot . $value . $quot;
                break;
            case 'bool':
                $value = $value ? 'true' : 'false';
                break;
            case 'int':
                $value = intval($value);
                break;
        }
        $result .= $value . ");\n";
        return $result;
    }
270854
public function editor($name, array $options = []): FieldTypeInterface
    {
        return (new EditorType($name))
            ->setLocale($this->app->getLocale())
            ->setViewFactory($this->viewFactory)
            ->setOptions($options);
    }
723539
public function exchange($name, $type = ExchangeType::DIRECT, array $options = [])
    {
        return $this->exchanges[$name] = (new ExchangeBuilder($this, $name, $type))->options($options);
    }
1014655
protected function makeField($name, $type = 'text', array $options = [])
    {
        $this->setupFieldOptions($name, $options);

        $fieldName = $this->getFieldName($name);

        $fieldType = $this->getFieldType($type);

        $field = new $fieldType($fieldName, $type, $this, $options);

        $this->eventDispatcher->dispatch(new AfterFieldCreation($this, $field));

        return $field;
    }
1164448
protected function getFieldId($name, array $options = [])
    {
        if (Arr::has($options, 'field.id')) {
            return Arr::get($options, 'field.id');
        }

        return 'field-' . str_replace('_', '-', $name);
    }
867659
public static function file($name, $options = [])
    {
        self::exclure($options);

        return self::input('file', $name, null, $options);
    }
957068
public function textarea($name, $value = '', $options = [])
    {
        if (!isset($options['id'])) {
            $options['id'] = $name;
        }

        $options['name'] = $name;

        return '<textarea'.$this->attributes($options).'>'.$value.'</textarea>';
    }
1081721
private function setFormFieldLabel($name, $options)
    {
        if (isset($options['label']) && $options['label'] != false) {
            $label = isset($options['label']) ? $options['label'] : $this->formatFieldLabel($name);

            return FormFacade::label($name, $label, ['class' => 'form-label']).'&nbsp;';
        } elseif (!isset($options['label'])) {
            return FormFacade::label($name, $this->formatFieldLabel($name), ['class' => 'form-label']).'&nbsp;';
        }
    }