index.tpl
Module Development (Form Tools 3)
All HTML within Form Tools is generated through the Smarty template language.
Your index.tpl
file is used to render the markup for your index.php
file. As mentioned
before, your template files can be located anywhere in your module folder, but we recommend putting them
all within a templates/
subfolder for consistency with the other modules.
Here's the index.tpl file from the Hello World! module. All it does it output a localized "hello world!" string.
The ft_include
method is used to include other templates within the main theme. It
does some clever stuff behind the scenes to first look for the file in the current users theme, then inherit
from the default theme if it's not defined there.
By and large you'll only ever be includes the header and footer as illustrated above. But if you want to include
templates within your own module, you'll want to use the default Smarty {include file="..."}
method.