अनुक्रम module.xmlपर प्रभाव पड़ता है app/etc/config.php। जब आप चलाते हैं bin/magento module:enable Vendor_ModuleNameतो यह फ़ाइल अपडेट हो जाती है यदि आपने अनुक्रम जोड़ा / बदला है तो मैं आपके मॉड्यूल को अक्षम करने और फिर इसे सक्षम करने का सुझाव दूंगा। अपनी module.xmlफ़ाइल को अपडेट करना और अपना कैश साफ़ करना यहाँ पर्याप्त नहीं है, आपको विकास के दौरान अनुक्रम परिवर्तन देखने के लिए Magento प्राप्त करने के लिए एक पूर्ण disableपुन: enableचक्र करने की आवश्यकता होगी ।
config.phpफ़ाइल में मॉड्यूल के क्रम को तब एंटोन की टिप्पणी के अनुसार अन्य सभी कॉन्फ़िगरेशन फ़ाइल लोड करने के लिए उपयोग किया जाता है।
उस टिप्पणी में कोड स्थान थोड़ा पुराना है। यह अनुक्रम क्रमबद्ध है https://github.com/magento/magento2/blob/2.0.2/lib/internal/Magento/Framework/Module/ModuleList/Loader.php#L131
अपडेट 2:
एप्लिकेशन / etc / di.xml
<type name="Magento\Framework\View\Model\Layout\Merge">
<arguments>
<argument name="fileSource" xsi:type="object">Magento\Framework\View\Layout\File\Collector\Aggregated\Proxy</argument>
<argument name="pageLayoutFileSource" xsi:type="object">pageLayoutFileCollectorAggregated</argument>
<argument name="cache" xsi:type="object">Magento\Framework\App\Cache\Type\Layout</argument>
</arguments>
</type>
जो एक ही di.xml में पेज लेआउट फ़ाइल कलेक्टर का संदर्भ देता है
<virtualType name="pageLayoutFileCollectorAggregated" type="Magento\Framework\View\Layout\File\Collector\Aggregated">
<arguments>
<argument name="baseFiles" xsi:type="object">pageLayoutFileSourceBaseSorted</argument>
<argument name="themeFiles" xsi:type="object">pageLayoutFileSourceThemeSorted</argument>
<argument name="overrideBaseFiles" xsi:type="object">pageLayoutFileSourceOverrideBaseSorted</argument>
<argument name="overrideThemeFiles" xsi:type="object">pageLayoutFileSourceOverrideThemeSorted</argument>
</arguments>
</virtualType>
जो हमें रुचिकर लगता है, वह pageLayoutFileSourceBaseSortedअभी भी उसी di.xml में है
<virtualType name="pageLayoutFileSourceBaseSorted" type="Magento\Framework\View\File\Collector\Decorator\ModuleDependency">
<arguments>
<argument name="subject" xsi:type="object">pageLayoutFileSourceBaseFiltered</argument>
</arguments>
</virtualType>
Magento\Framework\View\File\Collector\Decorator\ModuleDependency निम्नलिखित छँटाई करता है
protected function getModulePriority($moduleName)
{
if ($this->orderedModules === null) {
$this->orderedModules = $this->moduleList->getNames();
}
$result = array_search($moduleName, $this->orderedModules);
// Assume unknown modules have the same priority, distinctive from known modules
if ($result === false) {
return -1;
}
return $result;
}
जहां moduleListपर आधारित है, Magento\Framework\Module\ModuleListजो ऊपर दिए गए लोडर का उपयोग करता है।