sfWidgetFormTextarea.class.php 1.5 KB

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