/
githubmirror
/
magento2
Обзор
Документация
Войти
/
githubmirror
/
magento2
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
2.4-develop
lib/internal/Magento/Framework/Controller/Result/Forward.php
113 строк
2 KB
Alexandra Zota
ACP2E-4019: CE copyright updates for 2.4.9-beta1
22 окт 2025, 17:47
22 окт 2025, 17:47
1b769b7
Код
Авторство
О чём код?
<?php /** * Copyright 2014 Adobe * All Rights Reserved. */ declare(strict_types=1); namespace Magento\Framework\Controller\Result; use Magento\Framework\App\RequestInterface; use Magento\Framework\App\Response\HttpInterface as HttpResponseInterface; use Magento\Framework\Controller\AbstractResult; /** * Forward Controller Result * * @api */ class Forward extends AbstractResult { /** * @var \Magento\Framework\App\RequestInterface */ protected $request; /** * @var string */ protected $module; /** * @var string */ protected $controller; /** * @var array */ protected $params = []; /** * @param RequestInterface $request */ public function __construct(RequestInterface $request) { $this->request = $request; } /** * @param string $module * @return $this */ public function setModule($module) { $this->module = $module; return $this; } /** * @param string $controller * @return $this */ public function setController($controller) { $this->controller = $controller; return $this; } /** * @param array $params * @return $this */ public function setParams(array $params) { $this->params = $params; return $this; } /** * @param string $action * @return $this */ public function forward($action) { $this->request->initForward(); if (!empty($this->params)) { $this->request->setParams($this->params); } if (!empty($this->controller)) { $this->request->setControllerName($this->controller); // Module should only be reset if controller has been specified if (!empty($this->module)) { $this->request->setModuleName($this->module); } } $this->request->setActionName($action); $this->request->setDispatched(false); return $this; } /** * {@inheritdoc} */ protected function render(HttpResponseInterface $response) { return $this; } }