Cake\View\Helper\FormHelper::widget PHP Method

widget() public method

This is a lower level method. For built-in widgets, you should be using methods like text, hidden, and radio. If you are using additional widgets you should use this method render the widget without the label or wrapping div.
public widget ( string $name, array $data = [] ) : string
$name string The name of the widget. e.g. 'text'.
$data array The data to render.
return string
    public function widget($name, array $data = [])
    {
        $secure = null;
        if (isset($data['secure'])) {
            $secure = $data['secure'];
            unset($data['secure']);
        }
        $widget = $this->_registry->get($name);
        $out = $widget->render($data, $this->context());
        if (isset($data['name']) && $secure !== null && $secure !== self::SECURE_SKIP) {
            foreach ($widget->secureFields($data) as $field) {
                $this->_secure($secure, $this->_secureFieldName($field));
            }
        }
        return $out;
    }

Usage Example

 public function widget($name, array $data = [])
 {
     return parent::widget($name, $this->_getDefaultTemplateVars($data));
 }
All Usage Examples Of Cake\View\Helper\FormHelper::widget