public function render(array $data, ContextInterface $context)
    {
        $data += [
            'name' => '',
            'val' => null,
            'type' => 'text',
            'escape' => true,
        ];
        $data['value'] = $data['val'];
        $data['readonly'] = 'readonly';
        unset($data['val']);
        $this->_loadAssets();

        $data['class'] = !empty($data['class']) ? "{$data['class']} fontselector" : 'fontselector';

        return $this->_templates->format('input', [
            'name' => $data['name'],
            'type' => 'text',
            'attrs' => $this->_templates->formatAttributes(
                $data,
                ['name', 'type']
            ),
        ]) . '<p id="' . $data['id'] . '-preview" style="font:' . $data['value'] . ';">Example text</p>';
    }
public function render(array $data, ContextInterface $context)
    {
        $data += [
            'name' => '',
            'val' => null,
            'type' => 'text',
            'escape' => true,
        ];
        $data['value'] = $data['val'];
        $data['readonly'] = 'readonly';
        unset($data['val']);
        $this->_loadAssets();

        $data['class'] = !empty($data['class']) ? "{$data['class']} fontselector" : 'fontselector';

        return $this->_templates->format('input', [
            'name' => $data['name'],
            'type' => 'text',
            'attrs' => $this->_templates->formatAttributes(
                $data,
                ['name', 'type']
            ),
        ]) . '<p id="' . $data['id'] . '-preview" style="font:' . $data['value'] . ';">Example text</p>';
    }
public function render ( array $ data , ContextInterface $ context ) { $ data += [ 'name' => '' , 'val' => null , 'type' => 'text' , 'escape' => true , ] ; $ data [ 'value' ] = $ data [ 'val' ] ; $ data [ 'readonly' ] = 'readonly' ; unset ( $ data [ 'val' ] ) ; $ this -> _loadAssets ( ) ; $ data [ 'class' ] = ! empty ( $ data [ 'class' ] ) ? "{$data['class']} fontselector" : 'fontselector' ; return $ this -> _templates -> format ( 'input' , [ 'name' => $ data [ 'name' ] , 'type' => 'text' , 'attrs' => $ this -> _templates -> formatAttributes ( $ data , [ 'name' , 'type' ] ) , ] ) . '<p id="' . $ data [ 'id' ] . '-preview" style="font:' . $ data [ 'value' ] . ';">Example text</p>' ; }
Render a color picker widget.

@param array $data The data to build an input with.
@param \Cake\View\Form\ContextInterface $context The current form context.
@return string
Render a color picker widget .