Class

FileTemplate

Package: IO\Template Copyright: © 2005-2019 PHPBoost License: GNU/GPL-3.0 Author: Loic ROUCHON horn@phpboost.com Version: PHPBoost 5.2 - last update: 2016 10 24 Since: PHPBoost 3.0 - 2009 06 18 Contributor: Regis VIARRE crowkait@phpboost.com Contributor: Arnaud GENET elenwii@phpboost.com Located at: io/template/FileTemplate.class.php

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.

AbstractTemplate implements Template
Extended by FileTemplate
Methods summary
public
# __construct( string $file_identifier )

Builds a FileTemplate object

public string
# render( )

Returns a string representation of the view.

Properties inherited from AbstractTemplate
$data, $loader, $renderer