5

I have an xml like this.

<?xml version="1.0"?>
<config>
<modules>
<Vertax_Blog>
  <active>true</active>
  <codePool>local</codePool>            
        <depends>
            <Mage_Cms />
        </depends>
  <version>0.1.0</version>
</Vertax_Blog>
</modules>
</config>

Now I want to use another module, say Mage_Catalog, how can I declare this in xml.

<depends>
<Mage_Cms>
<Mage_Catalog>
</depends>

Is this the appropriate way or Is magento can accept multiple dependencies like this.

6

the correct way is

<depends>
    <Mage_Cms/>
    <Mage_Catalog/>
</depends>

the slash is very important to show the element is selfcontaining, else you will get parsing errors about open but not closed tags.

  • So we can use any number of modules here, good to know, but don't they conflict on some point, when loading the modules. – Waseem Feb 27 '14 at 12:14
  • you should avoid circle references like Module A depends on Module B which depends on Module C which depends on Module A. Else there will be no conflicts, it only makes sure the module is loaded before your module is. Or for which case do you see conflicts? If a module is already loaded, it does not get loaded twice. – Flyingmana Feb 27 '14 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.