当前位置: 首页>>代码示例>>PHP>>正文


PHP Frontend::getRootPageFromUrl方法代码示例

本文整理汇总了PHP中Frontend::getRootPageFromUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Frontend::getRootPageFromUrl方法的具体用法?PHP Frontend::getRootPageFromUrl怎么用?PHP Frontend::getRootPageFromUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Frontend的用法示例。


在下文中一共展示了Frontend::getRootPageFromUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getData

 /**
  * Get all youtube setting, considering root page and content element & module config
  *
  * @return array the settings
  */
 public function getData()
 {
     $arrData = array();
     $objRoot = \Frontend::getRootPageFromUrl();
     if ($objRoot === null) {
         return $arrData;
     }
     if (!is_array($this->arrData)) {
         $this->arrData = array();
     }
     $arrRootPageData = \HeimrichHannot\Haste\Util\Arrays::filterByPrefixes($objRoot->row(), self::$arrayKeyPrefixes);
     // array_filter() : do not overwrite empty values
     $arrData = array_merge(array_filter($arrRootPageData, 'strval'), array_filter($this->arrData, 'strval'));
     return $arrData;
 }
开发者ID:heimrichhannot,项目名称:contao-youtube,代码行数:20,代码来源:YouTubeSettings.php

示例2: getPageIdFromUrlHook

 public static function getPageIdFromUrlHook($arrFragments)
 {
     $objParticipation = ParticipationModel::findPublishedByAlias(\Environment::get('request'));
     if ($objParticipation !== null) {
         $blnAddParticipation = true;
         // only one participation per alias is supported yet
         if ($objParticipation instanceof \Model\Collection) {
             $objParticipation = $objParticipation->current();
         }
         $objArchive = $objParticipation->getRelated('pid');
         if ($objArchive === null) {
             $blnAddParticipation = false;
         }
         // check if current page is in defined root
         if ($objArchive->defineRoot && $objArchive->rootPage > 0) {
             $objCurrentRootPage = \Frontend::getRootPageFromUrl();
             $objRootPage = \PageModel::findByPk($objArchive->rootPage);
             if ($objRootPage !== null && $objCurrentRootPage !== null) {
                 if ($objRootPage->domain != $objCurrentRootPage->domain) {
                     $blnAddParticipation = false;
                     ParticipationController::removeActiveParticipation();
                 }
             }
         }
         if ($blnAddParticipation) {
             ParticipationController::setActiveParticipation($objParticipation);
             if ($objArchive->addInfoMessage && $objArchive->infoMessageWith !== '') {
                 ParticipationMessage::addInfo(\String::parseSimpleTokens($objArchive->infoMessageWith, array('participation' => ParticipationController::getParticipationLabel($objParticipation, '', true))), PARTICIPATION_MESSAGEKEY_ACTIVE);
             }
         }
         if (($objConfig = ParticipationController::findParticipationDataConfigClass($objParticipation)) !== null) {
             global $objPage;
             $objJumpTo = $objConfig->getJumpToPage();
             // redirect first, otherwise participation process will run twice
             if ($objJumpTo !== null && $objPage->id != $objJumpTo->id) {
                 \Controller::redirect(\Controller::generateFrontendUrl($objJumpTo->row()));
             }
         }
     }
     return $arrFragments;
 }
开发者ID:heimrichhannot,项目名称:contao-participation,代码行数:41,代码来源:Hooks.php


注:本文中的Frontend::getRootPageFromUrl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。