Actions

API15

JHTML/addIncludePath

From Joomla! Documentation

< API15:JHTML
Revision as of 16:18, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Add a directory where JHTML should search for helpers. You may either pass a string or an array of directories.

[Edit Descripton]

Description:JHTML/addIncludePath

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;
}

[Edit See Also] SeeAlso:JHTML/addIncludePath

Examples

<CodeExamplesForm />