RequireCookie.php 655 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * Frontend form key content block
  8. */
  9. namespace Magento\Cookie\Block;
  10. /**
  11. * @api
  12. * @since 100.0.2
  13. */
  14. class RequireCookie extends \Magento\Framework\View\Element\Template
  15. {
  16. /**
  17. * Retrieve script options encoded to json
  18. *
  19. * @return string
  20. */
  21. public function getScriptOptions()
  22. {
  23. $params = [
  24. 'noCookieUrl' => $this->escapeUrl($this->getUrl('cookie/index/noCookies/')),
  25. 'triggers' => $this->escapeHtml($this->getTriggers())
  26. ];
  27. return json_encode($params);
  28. }
  29. }