Note.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Form note element
  8. *
  9. * @author Magento Core Team <core@magentocommerce.com>
  10. */
  11. namespace Magento\Framework\Data\Form\Element;
  12. use Magento\Framework\Escaper;
  13. class Note extends AbstractElement
  14. {
  15. /**
  16. * @param Factory $factoryElement
  17. * @param CollectionFactory $factoryCollection
  18. * @param Escaper $escaper
  19. * @param array $data
  20. */
  21. public function __construct(
  22. Factory $factoryElement,
  23. CollectionFactory $factoryCollection,
  24. Escaper $escaper,
  25. $data = []
  26. ) {
  27. parent::__construct($factoryElement, $factoryCollection, $escaper, $data);
  28. $this->setType('note');
  29. }
  30. /**
  31. * @return string
  32. */
  33. public function getElementHtml()
  34. {
  35. $html = $this->getBeforeElementHtml()
  36. . '<div id="'
  37. . $this->getHtmlId()
  38. . '" class="control-value admin__field-value">'
  39. . $this->getText()
  40. . '</div>'
  41. . $this->getAfterElementHtml();
  42. return $html;
  43. }
  44. }