Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FieldPlugin.php
Go to the documentation of this file.
1 <?php
7 
10 use Magento\Paypal\Model\Config\StructurePlugin as ConfigStructurePlugin;
11 
16 {
20  private $request;
21 
25  public function __construct(RequestInterface $request)
26  {
27  $this->request = $request;
28  }
29 
37  public function afterGetConfigPath(FieldConfigStructure $subject, $result)
38  {
39  if (!$result && $this->request->getParam('section') == 'payment') {
40  $result = preg_replace(
41  '@^(' . implode('|', ConfigStructurePlugin::getPaypalConfigCountries(true)) . ')/@',
42  'payment/',
43  $subject->getPath()
44  );
45  }
46 
47  return $result;
48  }
49 }
afterGetConfigPath(FieldConfigStructure $subject, $result)
Definition: FieldPlugin.php:37