Actions

API16

JForm/loadFolder

From Joomla! Documentation

< API16:JForm
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 load form descriptions from a complete folder.

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

loadFolder($name)
Parameter Name Default Value Description
$name $name The prefix-name of the XML files

Returns

boolean True on success, false otherwise.

Defined in

libraries/joomla/form/form.php

Importing

jimport( 'joomla.form.form' );

Source Body

public function loadFolder($name)
{
        $return = false;
 
        jimport('joomla.filesystem.folder');
        $files = array();
        foreach($this->addFormPath() as $path)
        {
                $temp_files = JFolder::files($path, $name, false, true);
                if(is_array($temp_files)) $files = array_merge($temp_files, $files);
        }
        if (count($files)) {
                foreach($files as $file) {
                        $result = $this->load($file, true, true);
                }
        } else {
                $result = true;
        }
 
        return $result;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />