### Options:
- escape - Whether or not the contents of the textarea should be escaped. Defaults to true.
public function textarea($fieldName, array $options = array()) { $options += ['rows' => 3]; $options = $this->_injectStyles($options, 'form-control'); return parent::textarea($fieldName, $options); }
/** * Creates a textarea widget * @param string $fieldName Field name, should be "Modelname.fieldname" * @param array $options HTML attributes and options * @return string */ public function textarea($fieldName, array $options = []) { $options = $this->optionsDefaults(['cols' => null, 'rows' => null], $options); return parent::textarea($fieldName, $options); }
public function textarea($fieldName, array $options = array()) { $default_options = ['autosize' => true]; $options = array_merge($default_options, $options); $script_block = null; if ($options['autosize']) { $this->AlaxosHtml->includeTextareaAutosizeJS(); if (isset($options['id'])) { $dom_id = $options['id']; } else { $dom_id = $this->_domId($fieldName); } $script = []; $script[] = $this->AlaxosHtml->config('jquery_variable') . '(document).ready(function(){'; $script[] = ' if(typeof(' . $this->AlaxosHtml->config('jquery_variable') . '("#' . $dom_id . '").autosize) != "undefined"){'; $script[] = ' ' . $this->AlaxosHtml->config('jquery_variable') . '("#' . $dom_id . '").autosize();'; $script[] = ' }'; $script[] = '});'; $script_block = $this->AlaxosHtml->scriptBlock(implode("\n", $script)); } unset($options['autosize']); return parent::textarea($fieldName, $options) . $script_block; }