Magento module correct place to put additional fil

2019-07-29 22:48发布

问题:

I'm writing a module that needs to send an xml string to a 3rd party once an order is placed. The xml is in a particular format that I need to keep it in. I was going to have the xml template stored somewhere so I could read it in and replace the required tags with my data in my observer.

My question is, where is the best place to store that xml file? Can I simply create a new folder in my module for "extras" and have it in there? Or is that bad practice?

Thanks

回答1:

Most XML files for modules are usually stored in /etc/. I would keep it there, and if you ever need to make changes, you'll know where to look, as all other XML config files are stored there.

Edit: by /etc/ I mean: /app/code/local/Name/Module/etc/