Actions

API16

JHtml/addIncludePath

From Joomla! Documentation

< API16:JHtml
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.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

static 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

public static function addIncludePath($path = '')
{
        // force path to array
        settype($path, 'array');
 
        // loop through the path directories
        foreach ($path as $dir)
        {
                if (!empty($dir) && !in_array($dir, JHtml::$includePaths)) {
                        array_unshift(JHtml::$includePaths, JPath::clean($dir));
                }
        }
 
        return JHtml::$includePaths;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />