1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://nette.org)
5: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
6: * @package Nette\Forms\Controls
7: */
8:
9:
10:
11: /**
12: * Multiline text input control.
13: *
14: * @author David Grudl
15: * @package Nette\Forms\Controls
16: */
17: class TextArea extends TextBase
18: {
19:
20: /**
21: * @param string label
22: * @param int width of the control
23: * @param int height of the control in text lines
24: */
25: public function __construct($label = NULL, $cols = NULL, $rows = NULL)
26: {
27: parent::__construct($label);
28: $this->control->setName('textarea');
29: $this->control->cols = $cols;
30: $this->control->rows = $rows;
31: }
32:
33:
34: /**
35: * Generates control's HTML element.
36: * @return Html
37: */
38: public function getControl()
39: {
40: $control = parent::getControl();
41: $control->setText($this->getValue() === '' ? $this->translate($this->emptyValue) : $this->value);
42: return $control;
43: }
44:
45: }
46: