Hi - Can someone explain the difference between a module file and a template file (tpl_)? Thanks.
Jason
Hi - Can someone explain the difference between a module file and a template file (tpl_)? Thanks.
Jason
Not sure I understand your question.
Although you defined a Template file you didn't define a Module file, no basis for comparison.
Anyway, a Module is to alter previously installed files in some way. Be it a Template file or a default Zen Cart file makes no difference to the Module, depending upon the use of the Module.
Generally speaking, a module influences a behaviour of your zenshop, while a template influences an appearance.
eg:
- a payment MODULE will enable a method (behaviour) for customers to pay for their purchases.
- the "classic green" TEMPLATE positions elements on your webpage and applies layout structures, colours and design features.
20 years a Zencart User
If you're referring to files in /includes/modules vs files in /includes/templates ... then ... whereas the files in /includes/modules/ are used to extract data from the database, crunch numbers, do logic-processing, and prepare data to be sent for display; the files in /includes/templates/ are used simply to render the display of the data built by the modules.
Essentially it boils down to templates being used only for display, and modules being used for business logic and intelligence.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Bookmarks