Tweak text area form builder.
This commit is contained in:
1 parent
a904c422b7
commit
fbcf6bf383
1 file changed
+22
-4
+22
-4
@@ -303,12 +303,30 @@ class FormBuilder {
|
||||
{
|
||||
if (isset($options['size']))
|
||||
{
|
||||
$segments = explode('x', $options['size']);
|
||||
|
||||
return array_merge($options, array('cols' => $segments[0], 'rows' => $segments[1]));
|
||||
return $this->setQuickTextAreaSize($options);
|
||||
}
|
||||
|
||||
return array_merge($options, array('cols' => 50, 'rows' => 10));
|
||||
// If the "size" attribute was not specified, we will just look for the regular
|
||||
// columns and rows attributes, using sane defaults if these do not exist on
|
||||
// the attributes array. We'll then return this entire options array back.
|
||||
$cols = array_get($options, 'cols', 50);
|
||||
|
||||
$rows = array_get($options, 'rows', 10);
|
||||
|
||||
return array_merge($options, compact('cols', 'rows'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the text area size using the quick "size" attribute.
|
||||
*
|
||||
* @param array $options
|
||||
* @return array
|
||||
*/
|
||||
protected function setQuickTextAreaSize($options)
|
||||
{
|
||||
$segments = explode('x', $options['size']);
|
||||
|
||||
return array_merge($options, array('cols' => $segments[0], 'rows' => $segments[1]));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user