Core/getAliasId

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

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

PCMS_Client->getAliasId()

Overview

Get the element id converted from the curent URL alias.

Arguments

None

Returns

The id of the Element currently active if the Alias is found. Otherwise 0.

Example

$objCms = PCMS_Client::getInstance();
 
/* The url is http://www.domain.com/info and there is an alias 
 * in the CMS with the name 'info'.
*/
$intId = $objCms->getAliasId();
$objElement = $objCms->[[Core/getElementById|getElementById]]($intId);
 
if (is_object($objElement)) {
    // Found the 'info' Element.
}