1. sfWidgetFormInputPassword.class.php
  2. /** * sfWidgetFormInputPassword represents a password HTML input tag. * * @package symfony * @subpackage widget * @author Fabien Potencier * @version SVN: $Id: sfWidgetFormInputPassword.class.php 9046 2008-05-19 08:13:51Z FabianLange $ */
  3. class sfWidgetFormInputPassword extends sfWidgetFormInput
  4. {
  5. /**
  6. * Configures the current widget.
  7. *
  8. * Available options:
  9. *
  10. * * always_render_empty: true if you want the input value to be always empty when rendering (true by default)
  11. *
  12. * @param array $options An array of options
  13. * @param array $attributes An array of default HTML attributes
  14. *
  15. * @see sfWidgetFormInput
  16. */
  17. protected function configure($options = array(), $attributes = array())
  18. {
  19. parent::configure($options, $attributes);
  20. $this->addOption('always_render_empty', true);
  21. $this->setOption('type', 'password');
  22. }
  23. /**
  24. * @param string $name The element name
  25. * @param string $value The password stored in this widget, will be masked by the browser.
  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 parent::render($name, $this->getOption('always_render_empty') ? null : $value, $attributes, $errors);
  36. }
  37. }

Debug toolbar