【发布时间】:2013-07-02 09:13:22
【问题描述】:
在Magento tutorial 之后,我意识到我不理解 magentos XML 文件中的大小写。我不知道什么时候应该以大写字母开头,什么时候应该是驼峰式,什么时候字符串应该全部小写。例如
<config>
<modules>...</modules>
<global>
<events>
<controller_front_init_routers>
<observers>
<Magentotutorial_configviewer_model_observer>
<type>singleton</type>
<class>Magentotutorial_Configviewer_Model_Observer</class>
<method>checkForConfigRequest</method>
</Magentotutorial_configviewer_model_observer>
</observers>
</controller_front_init_routers>
</events>
</global>
我知道,在点击观察者标签后,magento 将在 magentotutorial 文件夹中的 configviewer 文件夹的模型文件夹中查找名为 observer 的文件,然后将通过类标签中保存的名称查找一个类。(请更正如果我错了,我)
我不明白的是为什么观察者下的标签以大写开头,后面的单词都是小写,而类标签的所有单词都以大写字母开头
另一个例子是驼峰式的 codePool 和 frontName 标签
有人可以解释一下何时以及为什么使用大写字母和不使用大写字母。
【问题讨论】:
标签: magento