Support Joomla!

references:joomla.framework:application:jview-loadtemplate

Table of Contents

loadTemplate

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JView Method loadTemplate Reference loadTemplate() Never Work in Progress

Loads the template file.

The method will look in the specified search folders until it locates the file. It will first look in any paths that have been added to the view. Then it will look in the templates directory (if invoked from the Joomla! application), and will finally look in the view’s template directory.

The template filename is constructed based on the current layout and the current layout extension. If the optional $tpl parameter is specified, then an underscore and that value will be appended to the end of the current layout to determine the filename (so if the current layout is ‘default’, the layout extension ‘php’ and the $tpl parameter is ‘round’, then the template filename will be default_round.php.

If the specified template is found, then it will included, the output will be captured and the results will be returned. If the template file cannot be found, a 500 error will be thrown.

This method returns a string containing the output of the template.

Syntax

string loadTemplate ( $tpl )

$tpl string is a string containing the template name. This parameter is optional and if omitted defaults to null.

Examples

Example

echo $view->loadTemplate( 'round' );

might load the default_round.php file from either the site template directory or the view template directory and will display the results.


ISCUSSION~~

 
references/joomla.framework/application/jview-loadtemplate.txt (823 views) · Last modified: 2007/08/15 14:50