return $this->form->initial($this->name);
}
- public function renderWidget()
+ public function renderWidget($extra_attrs=array())
{
$widget = $this->field->widget;
- $extra_attrs = array();
- if (!array_key_exists('id', $widget->attrs)) {
+ if (!array_key_exists('id', $widget->attrs))
$extra_attrs['id'] = $this->autoId();
- }
if ($widget->embeds_errors)
$extra_attrs['errors'] = $this->errors;
return IPF_Form::renderErrorsAsHTML($this->errors);
}
- public function renderLabel()
+ public function renderLabel($extra_attrs=array())
{
$label = Tag::label()
+ ->attrs($extra_attrs)
->append($this->label);
$widget = $this->field->widget;