textarea() form()
A multi-line text field; the value is escaped, a rich editor can replace it.
form()->textarea($name, $desc = '', $extra = [], $replace = [])Опції
| Опція | Значення |
|---|---|
rows, cols | Size. |
no_escape | Print the value as it is (trusted HTML only). |
ckeditor | Make it a CKEditor 4 (the pinned ckeditor asset): see Rich text editors. |
tinymce | Make it a TinyMCE editor: see tinymce(). |
contenteditable | false drops the attribute. |
(input options) | desc, placeholder, class, sizing, tip, required, disabled, readonly... |
Приклад
Код
return form(['comment' => "Line one\nLine <two> & {braces}"])
->textarea('comment', ['rows' => 3])
->textarea('notes', 'Internal notes', ['rows' => 2, 'placeholder' => 'Only staff can see this']);Примітки
- The text is escaped (
<,&and template braces), so stored HTML shows as text.
Bootstrap 3 and 5
sizing applies under Bootstrap 5 always, under Bootstrap 3 only with CONF_SIZING_ON_SELECTS_ALL_FW.
Див. також: form/tinymce, form/rich_text, html/textarea