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 function widget($name, array $data = []) { return parent::widget($name, $this->_getDefaultTemplateVars($data)); }
/** * Overridden to pass FormHelper context-specific data. * * @param string $name widget name * @param array $data config data * @return string */ public function widget($name, array $data = []) { $data['horizontal'] = $this->_isHorizontal; if (isset($data['help'])) { $helpType = 'inline'; $helpText = ''; if ($data['horizontal']) { $helpType = 'block'; } if (is_array($data['help'])) { $helpText = $data['help']['text']; $helpType = $data['help']['type']; } else { $helpText = $data['help']; } $help = '<span class="help-' . $helpType . '">' . $helpText . '</span>'; $data['help'] = $help; } return parent::widget($name, $data); }