src/FieldHandlers/FieldHandler.php
public function renderInput($data = '', array $options = []) : string
    {
        $options = array_merge($this->defaultOptions, $this->fixOptions($options));

        $data = $this->getFieldValueFromData($data, $options);
        // Workaround for BLOBs
        if (is_resource($data)) {
            $data = stream_get_contents($data);
        }

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

        $options['label'] = !isset($options['label']) ? $this->renderName() : $options['label'];

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

        return $result;
    }
public function renderInput($data = '', array $options = []) : string
    {
        $options = array_merge($this->defaultOptions, $this->fixOptions($options));

        $data = $this->getFieldValueFromData($data, $options);
        // Workaround for BLOBs
        if (is_resource($data)) {
            $data = stream_get_contents($data);
        }

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

        $options['label'] = !isset($options['label']) ? $this->renderName() : $options['label'];

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

        return $result;
    }
public function renderInput ( $ data = '' , array $ options = [ ] ) : string { $ options = array_merge ( $ this -> defaultOptions , $ this -> fixOptions ( $ options ) ) ; $ data = $ this -> getFieldValueFromData ( $ data , $ options ) ; // Workaround for BLOBs if ( is_resource ( $ data ) ) { $ data = stream_get_contents ( $ data ) ; } if ( empty ( $ data ) && ! empty ( $ options [ 'default' ] ) ) { $ data = $ options [ 'default' ] ; } $ options [ 'label' ] = ! isset ( $ options [ 'label' ] ) ? $ this -> renderName ( ) : $ options [ 'label' ] ; $ searchOptions = $ this -> config -> getProvider ( 'renderInput' ) ; $ searchOptions = new $ searchOptions ( $ this -> config ) ; $ result = $ searchOptions -> provide ( $ data , $ options ) ; return $ result ; }
Render field input

This method prepares the form input for the given field,
including the input itself, label, pre-populated value,
and so on.  The result can be controlled via the variety
of options.

@param  mixed $data    Field data
@param  array  $options Field options
@return string          Field input HTML
Render field input