Tweaked HTML class to always try to add labels
Seems nesting HTML elements is a bit borked, will fix when I need to use it.
This commit is contained in:
parent
17609530e3
commit
bf1c4db74e
2 changed files with 34 additions and 18 deletions
|
@ -59,17 +59,25 @@ class HTML extends Object
|
|||
{
|
||||
$attributes = array('type' => $type);
|
||||
}
|
||||
|
||||
if (isset($attributes['label'], $attributes['name']))
|
||||
{
|
||||
$label = $this->label(array('for' => $attributes['name']), $attributes['label']);
|
||||
unset($attributes['label']);
|
||||
|
||||
return $label . $this->div($this->input($attributes));
|
||||
}
|
||||
}
|
||||
|
||||
return $this->element($method, $attributes, $contents);
|
||||
if (isset($attributes['label'], $attributes['name']))
|
||||
{
|
||||
$label = $this->label(array('for' => $attributes['name']), $attributes['label']);
|
||||
|
||||
if (!isset($attributes['title']))
|
||||
{
|
||||
$attributes['title'] = $attributes['label'];
|
||||
}
|
||||
|
||||
unset($attributes['label']);
|
||||
|
||||
return $label . $this->element('div', $this->$method($attributes));
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->element($method, $attributes, $contents);
|
||||
}
|
||||
}
|
||||
|
||||
// {{{ Get Instance
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue