Iframe.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Payment\Block\Transparent;
  7. /**
  8. * Iframe block for register specific params in layout
  9. *
  10. * @api
  11. * @since 100.0.2
  12. */
  13. class Iframe extends \Magento\Framework\View\Element\Template
  14. {
  15. const REGISTRY_KEY = 'transparent_form_params';
  16. /**
  17. * Core registry
  18. *
  19. * @var \Magento\Framework\Registry
  20. */
  21. protected $coreRegistry;
  22. /**
  23. * Constructor
  24. *
  25. * @param \Magento\Framework\View\Element\Template\Context $context
  26. * @param \Magento\Framework\Registry $registry
  27. * @param array $data
  28. */
  29. public function __construct(
  30. \Magento\Framework\View\Element\Template\Context $context,
  31. \Magento\Framework\Registry $registry,
  32. array $data = []
  33. ) {
  34. $this->coreRegistry = $registry;
  35. parent::__construct($context, $data);
  36. }
  37. /**
  38. * Preparing layout
  39. *
  40. * @return $this
  41. */
  42. protected function _prepareLayout()
  43. {
  44. $params = $this->coreRegistry->registry(self::REGISTRY_KEY);
  45. $this->setParams($params);
  46. return parent::_prepareLayout();
  47. }
  48. }