Number.php 693 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Number element.
  5. *
  6. * Class Number
  7. */
  8. class Number extends HTML_QuickForm_text
  9. {
  10. /**
  11. * @param string $elementName
  12. * @param string $elementLabel
  13. * @param array $attributes
  14. */
  15. public function __construct($elementName = null, $elementLabel = null, $attributes = null)
  16. {
  17. if (!isset($attributes['id'])) {
  18. $attributes['id'] = $elementName;
  19. }
  20. $attributes['type'] = 'number';
  21. $attributes['class'] = 'form-control';
  22. parent::__construct($elementName, $elementLabel, $attributes);
  23. $this->_appendName = true;
  24. $this->setType('number');
  25. }
  26. }