當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。