src/View/Widget/MaterializeCss/FileWidget.php
public function render(array $data, ContextInterface $context)
    {
        $data += [
            'name'         => '',
            'templateVars' => [],
            'escape'       => true
        ];

        unset($data['val']);

        $title = (Arr::key('title', $data)) ? $data['title'] : $data['name'];

        return $this->_templates->format('file', [
            'title'        => $title,
            'name'         => $data['name'],
            'templateVars' => $data['templateVars'],
            'attrs'        => $this->_templates->formatAttributes($data, ['name'])
        ]);
    }
public function render(array $data, ContextInterface $context)
    {
        $data += [
            'name'         => '',
            'templateVars' => [],
            'escape'       => true
        ];

        unset($data['val']);

        $title = (Arr::key('title', $data)) ? $data['title'] : $data['name'];

        return $this->_templates->format('file', [
            'title'        => $title,
            'name'         => $data['name'],
            'templateVars' => $data['templateVars'],
            'attrs'        => $this->_templates->formatAttributes($data, ['name'])
        ]);
    }
public function render ( array $ data , ContextInterface $ context ) { $ data += [ 'name' => '' , 'templateVars' => [ ] , 'escape' => true ] ; unset ( $ data [ 'val' ] ) ; $ title = ( Arr :: key ( 'title' , $ data ) ) ? $ data [ 'title' ] : $ data [ 'name' ] ; return $ this -> _templates -> format ( 'file' , [ 'title' => $ title , 'name' => $ data [ 'name' ] , 'templateVars' => $ data [ 'templateVars' ] , 'attrs' => $ this -> _templates -> formatAttributes ( $ data , [ 'name' ] ) ] ) ; }
Render a file upload form widget.

Data supports the following keys:

- `name` - Set the input name.
- `escape` - Set to false to disable HTML escaping.

All other keys will be converted into HTML attributes.
Unlike other input objects the `val` property will be specifically
ignored.

@param   array $data The data to build a file input with.
@param   \Cake\View\Form\ContextInterface $context The current form context.

@return  string HTML elements.
Render a file upload form widget .