Summary
- File
- Package hierarchy IO\Template
- Class hierarchy \AbstractTemplate \FileTemplate
This class allows you to handle a template file.
Your template files should have the .tpl extension. To be more efficient, this class uses a cache and parses each file only once.
File identifiers
The web site can have several themes whose files aren't in the same folders. When you load a file, you just have to load the generic file and the right template file will be loaded dynamically.
Kernel template file
When you want to load a kernel template file, the path you must indicate is only the name of the file, for example header.tpl loads /template/your_theme/header.tpl and if it doesn't exist, it will load /template/default/header.tpl.
Module template file
When you want to load a module template file, you must indicate the name of you module and then the name of the file like this: module/file.tpl which will load the /module/templates/file.tpl. If the user themes redefines the file.tpl file for the module module, the file templates/your_theme/modules/module/file.tpl will be loaded.
Menu template file
To load a file of a menu, use this kind of path: menus/my_menu/file.tpl which will load the /menus/my_menu/templates/file.tpl file.
Framework template file
To load a framework file, use a path like this: framework/package/file.tpl which will load /templates/your_theme/framework/package/file.tpl if the theme overrides it, otherwise /templates/default/framework/package/file.tpl will be used.