Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ModularSwitch.php
Go to the documentation of this file.
1 <?php
7 
13 class ModularSwitch implements RuleInterface
14 {
20  protected $ruleNonModular;
21 
27  protected $ruleModular;
28 
36  {
37  $this->ruleNonModular = $ruleNonModular;
38  $this->ruleModular = $ruleModular;
39  }
40 
47  public function getPatternDirs(array $params)
48  {
49  if (isset($params['module_name'])) {
50  return $this->ruleModular->getPatternDirs($params);
51  } else {
52  return $this->ruleNonModular->getPatternDirs($params);
53  }
54  }
55 }
__construct(RuleInterface $ruleNonModular, RuleInterface $ruleModular)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
Definition: website.php:18