Skip to content

Commit

Permalink
Use the widget objects for textarea.
Browse files Browse the repository at this point in the history
Use widgets instead of templates directly.
  • Loading branch information
markstory committed Feb 21, 2014
1 parent 1ba39b9 commit 1037b10
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/View/Helper/FormHelper.php
Expand Up @@ -1423,20 +1423,7 @@ public function __call($method, $params) {
*/
public function textarea($fieldName, $options = array()) {
$options = $this->_initInputField($fieldName, $options);
$value = null;

if (array_key_exists('val', $options)) {
$value = $options['val'];
if (!array_key_exists('escape', $options) || $options['escape'] !== false) {
$value = h($value);
}
}
unset($options['val']);
return $this->formatTemplate('textarea', [
'name' => $options['name'],
'value' => $value,
'attrs' => $this->_templater->formatAttributes($options, ['name']),
]);
return $this->widget('textarea', $options);
}

/**
Expand Down

0 comments on commit 1037b10

Please sign in to comment.