Support Joomla!

references:joomla.framework:application:jmodulehelper-getlayoutpath

Table of Contents

getLayoutPath

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

Get the path to a layout for a module

Syntax

string getLayoutPath ( $module, $layout = ‘default’ )

$module string The name of the module
$layout string The name of the module layout

Examples

Example 1

$path = JModuleHelper::getLayoutPath('mod_newsflash', 'horiz');
echo path;

Might create:

/htdocs/joomla15/modules/mod_newsflash/tmpl/horiz.php

If a template override for the requested module exists, the path will point to the layout file in the template directory, i.e:

/htdocs/joomla15/templates/beez/html/mod_newsflash/horiz.php

Note: The function only tests whether a template override layout file exists and will return the default modules path instead. If you misspell the module name, or accidently ommit the ‘mod_’ prefix, the resulting path may point to a non-existing file:

Example 1

$path = JModuleHelper::getLayoutPath('newsflash', 'horiz');
echo path;

Might create:

/htdocs/joomla15/modules/newsflash/tmpl/horiz.php

 
references/joomla.framework/application/jmodulehelper-getlayoutpath.txt (590 views) · Last modified: 2007/08/15 14:50