* @link https://www.oxidmodule.com */ declare(strict_types=1); namespace D3\PRGredirects\Application\Core; use D3\PRGredirects\Modules\Core\Utils_PRGredirect; use OxidEsales\Eshop\Core\Registry; trait redirectControllerTrait { protected function d3DoPRGRedirect() { if ($this->d3ShouldDoPRGredirect()) { /** @var Utils_PRGredirect $utils */ $utils = Registry::getUtils(); $utils->d3PrgRedirect( $this->generatePageNavigationUrl() ); } } /** * @return bool */ protected function d3ShouldDoPRGredirect(): bool { return strtoupper($_SERVER['REQUEST_METHOD']) === 'POST' && Registry::getConfig()->getConfigParam('d3PRGredirect_'.$this->getClassKey()) === true; } }