API15

JHTML/addIncludePath: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Add a directory where JHTML should search for helpers. You may either pass a string or an array of directories. <span class="editsection" style="font-size:76%;"> <no...
 
m preparing for archive only
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JHTML/addIncludePath|Edit Descripton]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>


{{Description:JHTML/addIncludePath}}
<! removed transcluded page call, red link never existed >


===Syntax===
===Syntax===
Line 56: Line 56:


<span class="editsection" style="font-size:76%;">
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[SeeAlso:JHTML/addIncludePath|Edit See Also]]<nowiki>]</nowiki>
<nowiki>[<! removed edit link to red link >]</nowiki>
</span>
</span>
{{SeeAlso:JHTML/addIncludePath}}
<! removed transcluded page call, red link never existed >


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=addIncludePath
  category=addIncludePath
  category=JHTML
  category=JHTML
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*
  format= ,,,
  format= ,,,
</dpl>
</dpl>
[[Category:Archived pages API15]]

Latest revision as of 00:38, 25 March 2017

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