Actions

API16

JForm/addFieldPath

From Joomla! Documentation

< API16:JForm
Revision as of 17:50, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

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

[Edit Descripton]

Description:JForm/addFieldPath

Syntax

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

Returns

array The list of paths that have been added.

Defined in

libraries/joomla/form/form.php

Importing

jimport( 'joomla.form.form' );

Source Body

public static function addFieldPath($new = null)
{
        static $paths;
 
        if (!isset($paths)) {
                $paths = array(dirname(__FILE__).DS.'fields');
        }
 
        // 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] SeeAlso:JForm/addFieldPath

Examples

<CodeExamplesForm />