UrlInput.php 888 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. declare(strict_types=1);
  7. namespace Magento\Ui\Component\Form\Element;
  8. /**
  9. * Url Input to process data for urlInput component
  10. */
  11. class UrlInput extends \Magento\Ui\Component\Form\Element\AbstractElement
  12. {
  13. const NAME = 'urlInput';
  14. /**
  15. * Get component name
  16. *
  17. * @return string
  18. */
  19. public function getComponentName(): string
  20. {
  21. return static::NAME;
  22. }
  23. /**
  24. * {@inheritdoc}
  25. */
  26. public function prepare(): void
  27. {
  28. $config = $this->getData('config');
  29. //process urlTypes
  30. if (isset($config['urlTypes'])) {
  31. $links = $config['urlTypes']->getConfig();
  32. $config['urlTypes'] = $links;
  33. }
  34. $this->setData('config', (array)$config);
  35. parent::prepare();
  36. }
  37. }