Url.php 675 B

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