| 1 |
lars |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/*
|
|
|
4 |
* This file is part of the symfony package.
|
|
|
5 |
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
6 |
*
|
|
|
7 |
* For the full copyright and license information, please view the LICENSE
|
|
|
8 |
* file that was distributed with this source code.
|
|
|
9 |
*/
|
|
|
10 |
|
|
|
11 |
/**
|
|
|
12 |
* sfWidgetFormTextarea represents a textarea HTML tag.
|
|
|
13 |
*
|
|
|
14 |
* @package symfony
|
|
|
15 |
* @subpackage widget
|
|
|
16 |
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
|
|
17 |
* @version SVN: $Id: sfWidgetFormTextarea.class.php 30762 2010-08-25 12:33:33Z fabien $
|
|
|
18 |
*/
|
|
|
19 |
class sfWidgetFormTextarea extends sfWidgetForm
|
|
|
20 |
{
|
|
|
21 |
/**
|
|
|
22 |
* Configures the current widget.
|
|
|
23 |
*
|
|
|
24 |
* @param array $options An array of options
|
|
|
25 |
* @param array $attributes An array of default HTML attributes
|
|
|
26 |
*
|
|
|
27 |
* @see sfWidgetForm
|
|
|
28 |
*/
|
|
|
29 |
protected function configure($options = array(), $attributes = array())
|
|
|
30 |
{
|
|
|
31 |
$this->setAttribute('rows', 4);
|
|
|
32 |
$this->setAttribute('cols', 30);
|
|
|
33 |
}
|
|
|
34 |
|
|
|
35 |
/**
|
|
|
36 |
* Renders the widget.
|
|
|
37 |
*
|
|
|
38 |
* @param string $name The element name
|
|
|
39 |
* @param string $value The value displayed in this widget
|
|
|
40 |
* @param array $attributes An array of HTML attributes to be merged with the default HTML attributes
|
|
|
41 |
* @param array $errors An array of errors for the field
|
|
|
42 |
*
|
|
|
43 |
* @return string An HTML tag string
|
|
|
44 |
*
|
|
|
45 |
* @see sfWidgetForm
|
|
|
46 |
*/
|
|
|
47 |
public function render($name, $value = null, $attributes = array(), $errors = array())
|
|
|
48 |
{
|
|
|
49 |
return $this->renderContentTag('textarea', self::escapeOnce($value), array_merge(array('name' => $name), $attributes));
|
|
|
50 |
}
|
|
|
51 |
}
|