API16

JFolder/exists: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
New page: ===Description=== Wrapper for the standard file_exists function <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowi...
 
Line 44: Line 44:


===Examples===
===Examples===
<CodeExamplesForm />
<source lang="php">
<dpl>
JFolder::exists("images/banners");
noresultsheader=\n
</source>
category=exists
category=JFolder
category=CodeExample
category=MethodExample
include=*
format= ,,,
</dpl>

Revision as of 16:17, 30 September 2011

Description

Wrapper for the standard file_exists function

[Edit Descripton]

Template:Description:JFolder/exists

Syntax

static exists($path)
Parameter Name Default Value Description
$path Folder name relative to installation dir

Returns

boolean True if path is a folder

Defined in

libraries/joomla/filesystem/folder.php

Importing

jimport( 'joomla.filesystem.folder' );

Source Body

public static function exists($path)
{
        return is_dir(JPath::clean($path));
}

[Edit See Also] Template:SeeAlso:JFolder/exists

Examples

JFolder::exists("images/banners");