Render a TextField

@param TextField $textField
@return string
161224
public function textField(TextField $textField)
    {
        $tag = new Tag('input');
        $tag->setAttribute('type', $textField->getType());

        return $this->parseTag($tag, $textField);
    }
1351233
protected function renderDescription($text, $isFieldset = false)
    {
        $output = '';

        // Help text.
        if (!empty($text)) {
            // Allow for links in the help text, so no filtering anymore.
            $wrapperType = $isFieldset ? 'fieldsetDescription' : 'description';
            $output .= $this->getWrapper($wrapperType);
            $output .= $text;
            $output .= $this->getWrapperEnd($wrapperType);
        }

        return $output;
    }
455905
function forms_html($form, $field)
	{
		$value = isset($form->values[$field['name']]) ?
			$form->values[$field['name']] :
			(isset($field['value'])?$field['value']:'');
		$preset = isset($field['preset']) ? $field['preset'] : 'default';
		$result = "\t\t" . '<tr><td colspan="2">' . $field['label'] .
			'<br /><textarea name="wyswyg_' . $field['name'] . '" class="tinymce_' . $preset .
			'" cols="80" rows="25" style="width: 100%; height: ' .
			$field['height'].';">'.str_replace('$(httpRoot)', Eresus_CMS::getLegacyKernel()->root,
			EncodeHTML($value)).'</textarea></td></tr>'."\n";

		if (!self::$scriptsInstalled)
		{
			Eresus_Kernel::app()->getPage()->linkScripts($this->root.'tiny_mce.js');
			Eresus_Kernel::app()->getPage()->linkScripts($this->root.'presets/'.$preset.'.js');
			self::$scriptsInstalled = true;
		}

		return $result;
	}
1280540
public function render_field($field)
    {
        // convert value to array
        $field['value'] = acf_get_array($field['value'], false);

        // add empty value (allows '' to be selected)
        if (empty($field['value'])) {
            $field['value'][''] = '';
        }

        // placeholder
        if (empty($field['placeholder'])) {
            $field['placeholder'] = __("Select",'acf');
        }

        // vars
        $atts = array(
            'id'                => $field['id'],
            'class'             => $field['class'],
            'name'              => $field['name'],
            'data-multiple'     => $field['multiple'],
            'data-placeholder'  => $field['placeholder'],
            'data-allow_null'   => $field['allow_null']
        );

        // multiple
        if ($field['multiple']) {
            $atts['multiple'] = 'multiple';
            $atts['size'] = 5;
            $atts['name'] .= '[]';
        }

        // special atts
        foreach (array( 'readonly', 'disabled' ) as $k) {
            if (!empty($field[ $k ])) {
                $atts[ $k ] = $k;
            }
        }

        // vars
        $els = array();
        // $choices = array();

        $posttypes = $this->post_type_options();
        foreach ($posttypes as $pt) {
            $els[] = array(
                'type' => 'option',
                'value' => $pt['value'],
                'label' => $pt['label'],
                'selected' => in_array($pt['value'], $field['value'])
            );
        }

        // null
        if ($field['allow_null']) {
            array_unshift($els, array(
                'type' => 'option',
                'value' => '',
                'label' => '- ' . $field['placeholder'] . ' -'
            ));
        }

        // html
        echo '<select ' . acf_esc_attr($atts) . '>';

        // construct html
        if (!empty($els)) {
            foreach ($els as $el) {
                // extract type
                $type = acf_extract_var($el, 'type');
                if ($type == 'option') {
                    // get label
                    $label = acf_extract_var($el, 'label');
                    // validate selected
                    if (acf_extract_var($el, 'selected')) {
                        $el['selected'] = 'selected';
                    }

                    // echo
                    echo '<option ' . acf_esc_attr($el) . '>' . $label . '</option>';
                } else {
                    // echo
                    echo '<' . $type . ' ' . acf_esc_attr($el) . '>';
                }


            }

        }

        echo '</select>';
    }
935730
public function ajax($url, $idField = 'id', $textField = 'text')
    {
        $configs = array_merge([
            'allowClear'         => true,
            'placeholder'        => $this->label,
            'minimumInputLength' => 1,
        ], $this->config);

        $configs = json_encode($configs);
        $configs = substr($configs, 1, strlen($configs) - 2);

        $this->script = <<<EOT

$("{$this->getElementClassSelector()}").select2({
  ajax: {
    url: "$url",
    dataType: 'json',
    delay: 250,
    data: function (params) {
      return {
        q: params.term,
        page: params.page
      };
    },
    processResults: function (data, params) {
      params.page = params.page || 1;

      return {
        results: $.map(data.data, function (d) {
                   d.id = d.$idField;
                   d.text = d.$textField;
                   return d;
                }),
        pagination: {
          more: data.next_page_url
        }
      };
    },
    cache: true
  },
  $configs,
  escapeMarkup: function (markup) {
      return markup;
  }
});

EOT;

        return $this;
    }
916337
public function render(FileField $field)
	{
		$required = null;

		if($field->hasRule('ch\metanet\formHandler\rule\RequiredRule'))
			$required = ' aria-required="true"';
		
		if($this->numberOfFiles <= 1)
			return '<input type="file" name="' . $field->getFormIdentifierAsString() . '" id="' . $field->getId() . '" ' . $this->getAttributesAsHtml() . $required . '>';
		
		$field->setLinkedLabel(false);
		
		$html = '<ul' . $this->getAttributesAsHtml() . '>';
		
		for($i = 0; $i < $this->numberOfFiles; $i++) {
			$html .= '<li><input type="file" name="' . $field->getFormIdentifierAsString() . '[]" id="' . $field->getId() . '-' . $i . '" ' . ($i === 0 ? $required : null) . '></li>';
		}
		
		$html .= '</ul>';
		
		return $html;
	}
988689
public function text($field, $label) {
        $text = new Text($field, $label);
        array_push($this->_elements, $text);

        return $text;
    }
69849
private function renderGroup($groupField)
    {
        $group = [];

        foreach ($groupField as $field) {
            $group[] = $this->render($field);
        }

        $this->form .= view('platform::partials.fields.groups', [
            'cols' => array_filter($group),
        ])
            ->withErrors(session()->get('errors', app(ViewErrorBag::class)))
            ->render();
    }
644989
public function ezrichtext(Field $field)
    {
        return '<![CDATA[' . $this->richHtml5Converter->convert($field->value->xml)->saveHTML() . ']]>';
    }
642254
function renderAmazonField() {
		$this->renderField(
			[
				'id' => 'amazon',
				'name' => $this->getSlug(),
				'option' => 'amazon',
				'value' => ( isset( $this->options['amazon'] ) ) ? $this->options['amazon'] : '',
				'type' => 'url',
				'class' => 'regular-text code',
			]
		);
	}
845402
public function renderField()
    {
        list($name, $id) = $this->resolveNameID();

        TbArray::defaultValue('id', $id, $this->htmlOptions);
        TbArray::defaultValue('name', $name, $this->htmlOptions);

        // fixes #32: 'multiple' will be forced later in jQuery plugin
        $this->htmlOptions['multiple'] = 'multiple';

        if ($this->hasModel()) {
            echo CHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions);
        } else {
            echo CHtml::dropDownList($this->name, $this->value, $this->data, $this->htmlOptions);
        }
    }
146739
public function _render($textOnly) {
        $str = "";
        if ($textOnly)
            $str .= "\nModel Analysis\n==============\n";
        else
            $str .= "<h2>Model Analysis</h2>";
        $str .= $this->analyzeModel($this->configuration->getModel(), $textOnly);
        if ($textOnly)
            $str .= "\nConfiguration Analysis\n======================\n";
        else
            $str .= "</td><td valign='top'><h2>Configuration Analysis</h2>";
        $str .= $this->analyzeConfiguration($this->configuration, $textOnly);
        return $str;
    }
382694
function renderKoboField() {
		$this->renderField(
			[
				'id' => 'kobo',
				'name' => $this->getSlug(),
				'option' => 'kobo',
				'value' => ( isset( $this->options['kobo'] ) ) ? $this->options['kobo'] : '',
				'type' => 'url',
				'class' => 'regular-text code',
			]
		);
	}
380917
public function renderField(Field $field, array $params = [])
    {
        $params = $this->getRenderFieldBlockParameters($field, $params);

        return $this->fieldBlockRenderer->renderContentFieldView(
            $field->innerField,
            $field->fieldTypeIdentifier,
            $params
        );
    }
647367
public function renderField()
    {
        list($name, $id) = $this->resolveNameID();

        echo CHtml::openTag($this->tagName, array('id' => 'wrapper-' . $id));

        if ($this->hasModel()) {
            echo CHtml::activeCheckBox($this->model, $this->attribute, $this->htmlOptions);
        } else {
            echo CHtml::checkBox($name, $this->value, $this->htmlOptions);
        }

        echo CHtml::closeTag($this->tagName);
    }
487888
public function generateForm(): string
    {
        foreach ($this->fields as $field) {
            if (is_array($field)) {
                $this->renderGroup($field);
                continue;
            }

            $this->form .= $this->render($field);
        }

        return $this->form;
    }
763588
public function renderInput($table, string $field, $data = '', array $options = []) : string
    {
        $handler = self::getByTableField($table, $field, $options, $this->cakeView);

        return $handler->renderInput($data, $options);
    }