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