API15

API15:JParameter/addElementPath

From Joomla! Documentation

Revision as of 22:22, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Add a directory where JParameter should search for element types <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JParameter/addElem...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Add a directory where JParameter should search for element types

[Edit Descripton]

Template: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

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] Template:SeeAlso:JParameter/addElementPath

Examples

<CodeExamplesForm />