references:joomla.framework:application:jview-loadtemplateTable of Contents
loadTemplate
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. Syntaxstring loadTemplate ( $tpl )
ExamplesExample 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~~ |


