Url.php 666 B

123456789101112131415161718192021222324252627282930
  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. * @param string $elementName
  13. * @param string $elementLabel
  14. * @param array $attributes
  15. */
  16. public function __construct($elementName = null, $elementLabel = null, $attributes = null)
  17. {
  18. if (!isset($attributes['id'])) {
  19. $attributes['id'] = $elementName;
  20. }
  21. $attributes['type'] = 'url';
  22. $attributes['class'] = 'form-control';
  23. parent::__construct($elementName, $elementLabel, $attributes);
  24. $this->setType('url');
  25. }
  26. }