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: class TextArea extends TextBase
17: {
18: 
19:     /**
20:      * @param  string  label
21:      */
22:     public function __construct($label = NULL)
23:     {
24:         parent::__construct($label);
25:         $this->control->setName('textarea');
26:     }
27: 
28: 
29:     /**
30:      * Generates control's HTML element.
31:      * @return Nette\Utils\Html
32:      */
33:     public function getControl()
34:     {
35:         $value = $this->getValue();
36:         if ($value === '') {
37:             $value = $this->translate($this->emptyValue);
38:         }
39:         return parent::getControl()
40:             ->setText($value);
41:     }
42: 
43: }
44: