API15:JHTML/addIncludePath
From Joomla! Documentation
Description
Add a directory where JHTML should search for helpers. You may either pass a string or an array of directories.
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
addIncludePath($path='')
| Parameter Name | Default Value | Description |
|---|---|---|
| $path | A path to search. |
Returns
array An array with directory elements
Defined in
libraries/joomla/html/html.php
Importing
jimport( 'joomla.html.html' );
Source Body
function addIncludePath( $path='' )
{
static $paths;
if (!isset($paths)) {
$paths = array( JPATH_LIBRARIES.DS.'joomla'.DS.'html'.DS.'html' );
}
// force path to array
settype($path, 'array');
// loop through the path directories
foreach ($path as $dir)
{
if (!empty($dir) && !in_array($dir, $paths)) {
array_unshift($paths, JPath::clean( $dir ));
}
}
return $paths;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples