1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-08-04 12:17:42 +02:00

Merge pull request #16 from mbarzda/patch-4

Form Helper: adding id atributtes for form inputs
This commit is contained in:
Sergey Romaneko
2012-10-13 10:00:31 -07:00

View File

@@ -137,6 +137,9 @@
// Set the input name // Set the input name
$attributes['name'] = $name; $attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;
// Set the input value // Set the input value
$attributes['value'] = $value; $attributes['value'] = $value;
@@ -287,6 +290,9 @@
// Set the input name // Set the input name
$attributes['name'] = $name; $attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;
return '<textarea'.Html::attributes($attributes).'>'.$body.'</textarea>'; return '<textarea'.Html::attributes($attributes).'>'.$body.'</textarea>';
} }
@@ -310,6 +316,9 @@
// Set the input name // Set the input name
$attributes['name'] = $name; $attributes['name'] = $name;
// Set the input id
$attributes['id'] = (isset($attributes['id']))?$attributes['id']:$name;
$options_output = ''; $options_output = '';
foreach ($options as $value => $name) { foreach ($options as $value => $name) {