1. sfWidgetFormInput.class.php
  2. /** * sfWidgetFormInput represents an HTML input tag. * * @package symfony * @subpackage widget * @author Fabien Potencier * @version SVN: $Id: sfWidgetFormInput.class.php 22081 2009-09-16 13:28:26Z fabien $ */
  3. class sfWidgetFormInput extends sfWidgetForm
  4. {
  5. /**
  6. * Constructor.
  7. *
  8. * Available options:
  9. *
  10. * * type: The widget type
  11. *
  12. * @param array $options An array of options
  13. * @param array $attributes An array of default HTML attributes
  14. *
  15. * @see sfWidgetForm
  16. */
  17. protected function configure($options = array(), $attributes = array())
  18. {
  19. $this->addRequiredOption('type');
  20. // to maintain BC with symfony 1.2
  21. $this->setOption('type', 'text');
  22. }
  23. /**
  24. * @param string $name The element name
  25. * @param string $value The value displayed in this widget
  26. * @param array $attributes An array of HTML attributes to be merged with the default HTML attributes
  27. * @param array $errors An array of errors for the field
  28. *
  29. * @return string An HTML tag string
  30. *
  31. * @see sfWidgetForm
  32. */
  33. public function render($name, $value = null, $attributes = array(), $errors = array())
  34. {
  35. return $this->renderTag('input', array_merge(array('type' => $this->getOption('type'), 'name' => $name, 'value' => $value), $attributes));
  36. }
  37. }

Debug toolbar