| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Application |
JModuleHelper |
getLayoutPath |
getLayoutPath() |
Never | Work in Progress |
Get the path to a layout for a module
string getLayoutPath ( $module, $layout = ‘default’ )
| $module | string | The name of the module |
| $layout | string | The name of the module layout |
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