Forward.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Backend\Model\View\Result;
  7. use Magento\Backend\App\AbstractAction;
  8. use Magento\Backend\Model\Session;
  9. use Magento\Framework\App\ActionFlag;
  10. use Magento\Framework\App\RequestInterface;
  11. /**
  12. * @api
  13. * @since 100.0.2
  14. */
  15. class Forward extends \Magento\Framework\Controller\Result\Forward
  16. {
  17. /**
  18. * @var \Magento\Backend\Model\Session
  19. */
  20. protected $session;
  21. /**
  22. * @var \Magento\Framework\App\ActionFlag
  23. */
  24. protected $actionFlag;
  25. /**
  26. * @param RequestInterface $request
  27. * @param Session $session
  28. * @param ActionFlag $actionFlag
  29. */
  30. public function __construct(RequestInterface $request, Session $session, ActionFlag $actionFlag)
  31. {
  32. $this->session = $session;
  33. $this->actionFlag = $actionFlag;
  34. parent::__construct($request);
  35. }
  36. /**
  37. * @param string $action
  38. * @return $this
  39. */
  40. public function forward($action)
  41. {
  42. $this->session->setIsUrlNotice($this->actionFlag->get('', AbstractAction::FLAG_IS_URLS_CHECKED));
  43. return parent::forward($action);
  44. }
  45. }