1

Is there a convention for model alias names (or any alias names for that matter)? I.e. should it be

1.

<mynamespace_mymodulename>
    <class>MyNamespace_MyModuleName_Model</class>
</mynamespace_mymodulename>

or

2.

<mymodulename>
    <class>MyNamespace_MyModuleName_Model</class>
</mymodulename>

I've always used 1. and prefer it as there are less like to be conflicts. But I've noticed a few well respected modules on the market do otherwise.

1 Answer 1

1

There is no strict convention.

The 1st approach is accurate from architectural point of view and may seem the only way to go. However the purpose of aliases is to make module names shorter and prettier (which you can't say about mynamespace_mymodulename). I guess the people who chose the 2nd approach were thinking this way.

In Magento 2 aliases are dropped so it will not be a question anymore.

2
  • The purpose of an alias in a general sense is to make names shorter, but I'd say their more powerful and perhaps intended use in Magento is for rewrites? Commented May 2, 2014 at 9:34
  • Of course they are used for rewrites but I guess this was not the initial point of using them. Commented May 2, 2014 at 9:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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