API16

JForm/addFormPath

From Joomla! Documentation

< API16:JForm
Revision as of 17:50, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Method to add a path to the list of form include paths. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JForm/addFormPath|Edit Desc...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Method to add a path to the list of form include paths.

[Edit Descripton]

Template:Description:JForm/addFormPath

Syntax[edit]

static addFormPath($new=null)
Parameter Name Default Value Description
$new null $new A path or array of paths to add.

Returns[edit]

array The list of paths that have been added.

Defined in[edit]

libraries/joomla/form/form.php

Importing[edit]

jimport( 'joomla.form.form' );

Source Body[edit]

public static function addFormPath($new = null)
{
        static $paths;

        if (!isset($paths)) {
                $paths = array(dirname(__FILE__).DS.'forms');
        }

        // Force path to an array.
        settype($new, 'array');

        // Add the new paths to the list if not already there.
        foreach ($new as $path) {
                if (!in_array($path, $paths)) {
                        array_unshift($paths, trim($path));
                }
        }

        return $paths;
}

[Edit See Also] Template:SeeAlso:JForm/addFormPath

Examples[edit]

<CodeExamplesForm />