Actions

API16

JParameter/addElementPath

From Joomla! Documentation

< API16:JParameter
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 JParameter should search for element types.

[Edit Descripton]

Description:JParameter/addElementPath

Syntax

addElementPath($path)
Parameter Name Default Value Description
$path Directory or directories to search.

Defined in

libraries/joomla/html/parameter.php

Importing

jimport( 'joomla.html.parameter' );

Source Body

public function addElementPath($path)
{
        // Just force path to array.
        settype($path, 'array');
 
        // Loop through the path directories.
        foreach ($path as $dir) {
                // No surrounding spaces allowed!
                $dir = trim($dir);
 
                // Add trailing separators as needed.
                if (substr($dir, -1) != DIRECTORY_SEPARATOR) {
                        // Directory
                        $dir .= DIRECTORY_SEPARATOR;
                }
 
                // Add to the top of the search dirs.
                array_unshift($this->_elementPath, $dir);
        }
}

[Edit See Also] SeeAlso:JParameter/addElementPath

Examples

<CodeExamplesForm />