本文整理汇总了PHP中LeftAndMain::currentPageID方法的典型用法代码示例。如果您正苦于以下问题:PHP LeftAndMain::currentPageID方法的具体用法?PHP LeftAndMain::currentPageID怎么用?PHP LeftAndMain::currentPageID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LeftAndMain
的用法示例。
在下文中一共展示了LeftAndMain::currentPageID方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: currentPageID
/**
* Return fake-ID "root" if no ID is found (needed to upload files into the root-folder)
*/
public function currentPageID()
{
return ($result = parent::currentPageID()) === null ? 0 : $result;
}
示例2: currentPageID
public function currentPageID()
{
$id = parent::currentPageID();
$this->extend('updateCurrentPageID', $id);
// Fall back to homepage record
if (!$id) {
$homepageSegment = RootURLController::get_homepage_link();
$homepageRecord = DataObject::get_one('SiteTree', sprintf('"SiteTree"."URLSegment" = \'%s\'', Convert::raw2sql($homepageSegment)));
if ($homepageRecord) {
$id = $homepageRecord->ID;
}
}
return $id;
}
示例3: currentPageID
public function currentPageID()
{
$id = parent::currentPageID();
$this->extend('updateCurrentPageID', $id);
return $id;
}
示例4: currentPageID
public function currentPageID()
{
$id = parent::currentPageID();
// Fall back to homepage record
if (!$id) {
$homepageSegment = RootURLController::get_homepage_link();
$homepageRecord = DataObject::get_one('SiteTree', sprintf('"URLSegment" = \'%s\'', $homepageSegment));
if ($homepageRecord) {
$id = $homepageRecord->ID;
}
}
return $id;
}
示例5: currentPageID
function currentPageID()
{
$id = parent::currentPageID();
$reports = SS_Report::get_reports('ReportAdmin');
return isset($reports[$id]) ? $reports[$id] : null;
}