Core/getLanguages

From PunchCMS
Revision as of 22:29, 25 December 2008 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PCMS_Client->getLanguages()

Overview

Get a collection of all active languages.

Arguments

None

Returns

If Languages are found this method returns a Collection object containing all active languages. Otherwise an empty collection.
That way you can test if you get a valid return using the count() method.

Example

$objCms = PCMS_Client::getInstance();
 
// Get a collection of Languages.
$objLanguages = $objCms->getLanguages();
foreach ($objLanguages as $objLanguage) {
    // Loop through the collection.
}