Render field form input.

@param mixed $table Name or instance of the Table
@param string $field Field name
@param mixed $data Field data
@param mixed[] $options Field options
@return string Field input
763588
public function renderInput($table, string $field, $data = '', array $options = []) : string
    {
        $handler = self::getByTableField($table, $field, $options, $this->cakeView);

        return $handler->renderInput($data, $options);
    }
495550
public function serialize(Field $field, array $options = [])
    {
        $serialized = [
            'id' => $field->getUuid(),
            'autoId' => $field->getId(),
            'name' => $field->getName(),
            'label' => $field->getName(),
            'type' => $field->getFieldType(),
            'required' => $field->isRequired(),
            'help' => $field->getHelp(),
            'restrictions' => [
                'isMetadata' => $field->getIsMetadata(),
                'locked' => $field->isLocked(),
                'lockedEditionOnly' => $field->getLockedEditionOnly(),
                'hidden' => $field->isHidden(),
                'order' => $field->getOrder(),
            ],
        ];

        if (count($field->getDetails()) > 0) {
            $serialized['options'] = $field->getDetails();
        }
        if (in_array($field->getType(), [FieldFacet::CHOICE_TYPE, FieldFacet::CASCADE_TYPE])) {
            $serialized['options']['choices'] = array_map(function (FieldFacetChoice $choice) {
                return $this->fieldFacetChoiceSerializer->serialize($choice);
            }, $field->getFieldFacet()->getRootFieldFacetChoices());
        }
        if (!in_array(Options::SERIALIZE_MINIMAL, $options)) {
            $serialized = array_merge($serialized, [
                'fieldFacet' => $this->fieldFacetSerializer->serialize($field->getFieldFacet()),
            ]);
        } else {
            $serialized = array_merge($serialized, [
                'fieldFacet' => [
                    'id' => $field->getUuid(),
                ],
            ]);
        }

        return $serialized;
    }
822096
public function provide($data = null, array $options = [])
    {
        $field = $this->config->getField();
        $table = $this->config->getTable();

        $fieldName = $table->aliasField($field);

        $params = [
            'field' => $field,
            'name' => $fieldName,
            'type' => 'url',
            'label' => $options['label'],
            'required' => $options['fieldDefinitions']->getRequired(),
            'value' => $data,
            'extraClasses' => (!empty($options['extraClasses']) ? implode(' ', $options['extraClasses']) : ''),
            'attributes' => empty($options['attributes']) ? [] : $options['attributes'],
            'placeholder' => (!empty($options['placeholder']) ? $options['placeholder'] : ''),
        ];

        $defaultElement = 'CsvMigrations.FieldHandlers/BaseFieldHandler/input';
        $element = empty($options['element']) ? $defaultElement : $options['element'];

        return $this->renderElement($element, $params);
    }
859976
public function save($table, $data, $keys, $options = []) {
		return $this->object->save($table, $data, $keys, $options);
	}
11623
public function input($fieldName, $options = [])
    {
        //** we need to make the input combine with <span class="input-group-addon">@</span>
        if (isset($options['icon'])) {
            $icon = $this->Html->icon($options['icon']);

            $between = '<div class="input-group">' . '<span class="input-group-addon">' . $icon . '</span>';

            $after = '</div>';
            $options = [
                'between' => $between,
                'after' => $after,
            ];
        }
        if (!isset($options['placeholder'])) {
            $options['placeholder'] = __(Inflector::humanize(Inflector::underscore($fieldName)));
        }
        return parent::input($fieldName, $options);
    }
186776
protected function generateFieldHtml($fieldKey, $elementKey, $table, $datafield = "data")
    {
        $html = "";
        $fieldHelper = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('MASK\\Mask\\Helper\\FieldHelper');
        switch ($fieldHelper->getFormType($fieldKey, $elementKey, $table)) {
            case "Check":
                $html .= "{f:if(condition: " . $datafield . "." . $fieldKey . ", then: 'On', else: 'Off')}<br />\n\n";
                break;
            case "Content":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= "<f:for each=\"{" . $datafield . "." . $fieldKey . "}\" as=\"" . $datafield . "_item" . "\">\n";
                $html .= '<f:cObject typoscriptObjectPath="lib.tx_mask.content">{' . $datafield . '_item.uid}</f:cObject><br />' . "\n";
                $html .= "</f:for>\n";
                $html .= "</f:if>\n\n";
                break;
            case "Date":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:format.date format="d.m.Y">{' . $datafield . '.' . $fieldKey . '}</f:format.date><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Datetime":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:format.date format="d.m.Y - H:i:s">{' . $datafield . '.' . $fieldKey . '}</f:format.date><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "File":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:for each="{' . $datafield . '.' . $fieldKey . '}" as="file">
  <f:image image="{file}" alt="{file.alternative}" title="{file.title}" width="200" /><br />
  {file.description} / {file.identifier}<br />
</f:for>' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Float":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:format.number decimals="2" decimalSeparator="," thousandsSeparator=".">{' . $datafield . '.' . $fieldKey . '}</f:format.number><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Inline":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= "<ul>\n";
                $html .= "<f:for each=\"{" . $datafield . "." . $fieldKey . "}\" as=\"" . $datafield . "_item" . "\">\n<li>";
                $inlineFields = $this->storageRepository->loadInlineFields($fieldKey);
                if ($inlineFields) {
                    foreach ($inlineFields as $inlineField) {
                        $html .= $this->generateFieldHtml($inlineField["maskKey"], $elementKey, $fieldKey,
                                $datafield . "_item") . "\n";
                    }
                }
                $html .= "</li>\n</f:for>" . "\n";
                $html .= "</ul>\n";
                $html .= "</f:if>\n\n";
                break;
            case "Integer":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '{' . $datafield . '.' . $fieldKey . '}<br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Link":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:link.typolink parameter="{' . $datafield . '.' . $fieldKey . '}">{' . $datafield . '.' . $fieldKey . '}</f:link.typolink><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Radio":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:switch expression="{' . $datafield . '.' . $fieldKey . '}">
  <f:case value="1">Value is: 1</f:case>
  <f:case value="2">Value is: 2</f:case>
  <f:case value="3">Value is: 3</f:case>
</f:switch><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Richtext":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:format.html parseFuncTSPath="lib.parseFunc_RTE">{' . $datafield . '.' . $fieldKey . '}</f:format.html><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Select":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:switch expression="{' . $datafield . '.' . $fieldKey . '}">
  <f:case value="1">Value is: 1</f:case>
  <f:case value="2">Value is: 2</f:case>
  <f:case value="3">Value is: 3</f:case>
</f:switch><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "String":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '{' . $datafield . '.' . $fieldKey . '}<br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
            case "Text":
                $html .= '<f:if condition="{' . $datafield . '.' . $fieldKey . '}">' . "\n";
                $html .= '<f:format.nl2br>{' . $datafield . '.' . $fieldKey . '}</f:format.nl2br><br />' . "\n";
                $html .= "</f:if>\n\n";
                break;
        }
        return $html;
    }
959755
public function getForm(
        Action $action,
        Request $request,
        DataInterface $data,
        array $options = []
    ): FormInterface {
        $defaultOptions = $this->getDefaultFormOptions($action, $request, $data);

        return $this->getFormBuilder($action, $data, array_merge($defaultOptions, $options))->getForm();
    }
1166615
public function provide($data = null, array $options = [])
    {
        $label = $options['label'];

        $combinedFields = $this->config->getProvider('combinedFields');
        $combinedFields = new $combinedFields($this->config);
        $combinedFields = $combinedFields->provide($data, $options);

        $view = $this->config->getView();

        $inputs = [];
        foreach ($combinedFields as $suffix => $preOptions) {
            // Skip individual inputs' label
            $options['label'] = false;
            $fieldName = $this->config->getField() . '_' . $suffix;

            $fieldData = $data;
            if (empty($fieldData) && !empty($options['entity'])) {
                $fieldData = $options['entity'];
            }

            $config = new $preOptions['config']($fieldName, $this->config->getTable(), $options);
            $config->setView($view);
            $handler = new FieldHandler($config);

            $inputs[$fieldName] = $handler->renderInput($fieldData, $options);
        }

        $params = [
            'field' => $this->config->getField(),
            'label' => $label,
            'required' => $options['fieldDefinitions']->getRequired(),
            'inputs' => $inputs
        ];

        $defaultElement = 'CsvMigrations.FieldHandlers/CombinedFieldHandler/input';
        $element = empty($options['element']) ? $defaultElement : $options['element'];

        return $this->renderElement($element, $params);
    }
1366815
public function provide($data = null, array $options = [])
    {
        $field = $this->config->getField();

        $template = $this->getBasicTemplate('text');
        $defaultOptions = $this->getDefaultOptions($data, $options);
        $defaultOptions['input'] = ['content' => $template];

        $result[$field] = $defaultOptions;

        $relatedProperties = $this->_getRelatedProperties($options['fieldDefinitions']->getLimit(), '');

        $view = $this->config->getView();

        $content = sprintf(
            static::HTML_INPUT,
            $this->_getInputIcon($relatedProperties),
            $view->Form->control($field, [
                'label' => false,
                'name' => '{{name}}',
                'id' => $field,
                'type' => 'select',
                'data-type' => 'select2',
                'data-display-field' => $relatedProperties['displayField'],
                'data-magic-value' => isset($options['magic-value']) ?
                    (bool)$options['magic-value'] :
                    'Users' === $options['fieldDefinitions']->getLimit(),
                'escape' => false,
                'autocomplete' => 'off',
                'multiple' => isset($options['multiple']) ?
                    ((bool)$options['multiple'] ? 'multiple' : false) :
                    'multiple',
                'data-url' => $view->Url->build([
                    'prefix' => 'api',
                    'plugin' => $relatedProperties['plugin'],
                    'controller' => $relatedProperties['controller'],
                    'action' => 'lookup.json'
                ])
            ])
        );

        $result[$field]['display_field'] = $relatedProperties['displayField'];
        $result[$field]['source'] = Inflector::tableize($relatedProperties['controller']);
        $result[$field]['url'] = $view->Url->build([
            'prefix' => 'api',
            'plugin' => $relatedProperties['plugin'],
            'controller' => $relatedProperties['controller'],
            'action' => 'lookup.json'
        ]);
        $result[$field]['input'] = [
            'content' => $content,
            'post' => [
                [
                    'type' => 'script',
                    'content' => [
                        'CsvMigrations.dom-observer',
                        'AdminLTE./bower_components/select2/dist/js/select2.full.min',
                        'CsvMigrations.select2.init'
                    ],
                    'block' => 'scriptBottom'
                ],
                [
                    'type' => 'scriptBlock',
                    'content' => 'csv_migrations_select2.setup(' . json_encode(
                        array_merge(
                            Configure::read('CsvMigrations.select2'),
                            Configure::read('CsvMigrations.api')
                        )
                    ) . ');',
                    'block' => 'scriptBottom'
                ],
                [
                    'type' => 'css',
                    'content' => [
                        'AdminLTE./bower_components/select2/dist/css/select2.min',
                        'Qobo/Utils.select2-bootstrap.min',
                        'Qobo/Utils.select2-style'
                    ],
                    'block' => 'css'
                ]
            ]
        ];

        return $result;
    }
661284
public function renderInput(array $options = [])
    {
        $attrs = $this->prepareAttributes();

        if ($this->form && $this->form->getRenderer()) {
            return $this->form->getRenderer()->renderInput($this, $attrs, $options);
        }

        return $this->buildInput($attrs);
    }
512766
public function table($Label, $Table, $Options = array())
    {
        return $this->fb($Table, $Label, FirePHP::TABLE, $Options);
    }
293938
protected function form($name, array $options = [], array $data = [])
    {
        return \App::make('laravel-form-builder')->create($name, $options, $data);
    }
212882
public function renderFields($fieldset = null, $group = null, array $options = [])
    {
        $output = '';

        foreach ($this->getFields($fieldset, $group) as $field) {
            $output .= "\n" . $field->render($options);
        }

        return $output;
    }
549871
function render_field( $field ) {

		$maxrows = null;

		$disablesort = null;

		$defaultheaders = null;


		// vars
		$o = array( 'id', 'name' );
		$s = array( 'readonly', 'disabled' );
		$e = '';


		// maxlength
		if( $field['maxrows'] !== '' ) {

			$maxrows = 'data-maxrows="'.$field['maxrows'].'"';

		}

						// disable sort
		if( !empty($field['disable_sort']) ) $disablesort = ' data-disablesort="'.$field['disable_sort'].'"';

		// rows
		if( !empty($field['fixed_columns']) ) {

			$defaultheaders = preg_split( '/\r\n|\r|\n/',  $field['default_headers'] );

			$defaultheaders = 'data-defaultheaders="'.implode(",", $defaultheaders) .'"';
			if( empty($field['default_headers']) ) $defaultheaders = 'data-defaultheaders="No Default Headers Set"';

		}




		// populate atts
		$atts = array();
		foreach( $o as $k ) {

			$atts[ $k ] = $field[ $k ];

		}



		// special atts
		foreach( $s as $k ) {

			if( $field[ $k ] ) {

				$atts[ $k ] = $k;

			}

		}



		$e .= '<textarea style="display:none" '.$maxrows.' '.$disablesort.' '.$defaultheaders.' data-key="'.$field['key'].'" ' . acf_esc_attr( $atts ) . ' >';
		$e .= esc_textarea( $field['value'] );
		$e .= '</textarea>';


		// return
		echo $e;

	}
1141029
public function getFormBuilder(Action $action, $data, array $options = []): FormBuilderInterface
    {
        return $this->baseFormHelper->getFormBuilder($action, $data, $options);
    }
857501
public function renderRow($content, $type = null, $label = null, array $options = [])
    {
        $compound = false;

        if ($type == 'checkbox') {
            $content = $this->renderCheckboxWidget($content, $options);
        } elseif ($type == 'number') {
            $content = $this->renderNumberWidget($content, $options);
        } elseif ($type == 'textarea') {
            $content = $this->renderTextareaWidget($content, $options);
        } elseif ($type == 'entity') {
            $content = $this->renderEntityWidget($content, $options);
        } elseif ($type == 'url') {
            $content = $this->renderUrlWidget($content, $options);
        } elseif ($type == 'datetime' || $type == 'date') {
            if ($type == 'date') {
                $options['time'] = false;
            }
            $content = $this->renderDatetimeWidget($content, $options);
        } elseif ($type == 'tel') {
            $content = $this->renderTelWidget($content, $options);
        } elseif ($type == 'color') {
            $content = $this->renderColorWidget($content, $options);
        } elseif ($type == 'tinymce') {
            $content = $this->renderTinymceWidget($content, $options);
        } elseif ($type == 'upload') {
            $content = $this->renderUploadWidget($content, $options);
        } elseif ($type == 'media') {
            $content = $this->renderMediaWidget($content, $options);
        } elseif ($type == 'medias') {
            $content = $this->renderMediasWidget($content, $options);
        } elseif ($type == 'seo') {
            $content = $this->renderSeoWidget($content, $options);
        } elseif ($type == 'key_value_collection') {
            $content = $this->renderKeyValueCollectionWidget($content, $options);
        } elseif ($type == 'coordinate') {
            $content = $this->renderCoordinateWidget($content, $options);
        } else {
            $content = $this->renderSimpleWidget($content, $options);
        }

        $vars = [
            'label' => $label !== null ? $label : false,
            'content' => $content,
            'compound' => $compound
        ];

        /* Fix boostrap columns */
        $vars['label_nb_col'] = isset($options['label_nb_col']) ? intval($options['label_nb_col']) : (strlen($label) > 0 ? 2 : 0);
        $vars['nb_col'] = isset($options['nb_col']) ? intval($options['nb_col']) : 12 - $vars['label_nb_col'];

        return $this->renderBlock('show_row', $vars);
    }
143098
public function renderField(GridViewInterface $gridView, Field $field, $data)
    {
        $options = $this->parser->parseOptions(
            $this->shadowOptions[$field->getName()] ?? $this->shadowOptions[$field->getName()] = $field->getOptions(),
            $gridView->getRequestConfiguration()->getRequest(),
            $data
        );

        $field->setOptions($options);

        return $this->renderer->renderField($gridView, $field, $data);
    }