API16

JForm/loadFolder

From Joomla! Documentation

< API16:JForm

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


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

Syntax[edit]

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

Returns[edit]

boolean True on success, false otherwise.

Defined in[edit]

libraries/joomla/form/form.php

Importing[edit]

jimport( 'joomla.form.form' );

Source Body[edit]

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 transcluded page call, red link never existed >

Examples[edit]

Code Examples[edit]