當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Page::loadError方法代碼示例

本文整理匯總了PHP中Concrete\Core\Page\Page::loadError方法的典型用法代碼示例。如果您正苦於以下問題:PHP Page::loadError方法的具體用法?PHP Page::loadError怎麽用?PHP Page::loadError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Concrete\Core\Page\Page的用法示例。


在下文中一共展示了Page::loadError方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getFromRequest

 /**
  * Uses a Request object to determine which page to load. queries by path and then
  * by cID
  */
 public static function getFromRequest(Request $request)
 {
     // if something has already set a page object, we return it
     $c = $request->getCurrentPage();
     if (is_object($c)) {
         return $c;
     }
     if ($request->getPath() != '') {
         $path = $request->getPath();
         $r = array();
         $db = Loader::db();
         $cID = false;
         while (!$cID && $path) {
             $cID = $db->GetOne('select cID from PagePaths where cPath = ?', array($path));
             if ($cID) {
                 $cPath = $path;
                 break;
             }
             $path = substr($path, 0, strrpos($path, '/'));
         }
         if ($cID && $cPath) {
             $c = Page::getByID($cID, 'ACTIVE');
         } else {
             $c = new Page();
             $c->loadError(COLLECTION_NOT_FOUND);
         }
         return $c;
     } else {
         $cID = $request->query->get('cID');
         if (!$cID) {
             $cID = $request->request->get('cID');
         }
         $cID = Loader::helper('security')->sanitizeInt($cID);
         if (!$cID) {
             $cID = 1;
         }
         $c = Page::getByID($cID, 'ACTIVE');
     }
     return $c;
 }
開發者ID:meixelsberger,項目名稱:concrete5-5.7.0,代碼行數:44,代碼來源:Page.php

示例2: getFromRequest

 /**
  * Uses a Request object to determine which page to load. queries by path and then
  * by cID.
  */
 public static function getFromRequest(Request $request)
 {
     // if something has already set a page object, we return it
     $c = $request->getCurrentPage();
     if (is_object($c)) {
         return $c;
     }
     if ($request->getPath() != '') {
         $path = $request->getPath();
         $db = Database::get();
         $cID = false;
         $ppIsCanonical = false;
         while (!$cID && $path) {
             $row = $db->GetRow('select cID, ppIsCanonical from PagePaths where cPath = ?', array($path));
             if (!empty($row)) {
                 $cID = $row['cID'];
                 if ($cID) {
                     $cPath = $path;
                     $ppIsCanonical = (bool) $row['ppIsCanonical'];
                     break;
                 }
             }
             $path = substr($path, 0, strrpos($path, '/'));
         }
         if ($cID && $cPath) {
             $c = Page::getByID($cID, 'ACTIVE');
             $c->cPathFetchIsCanonical = $ppIsCanonical;
         } else {
             $c = new Page();
             $c->loadError(COLLECTION_NOT_FOUND);
         }
         return $c;
     } else {
         $cID = $request->query->get('cID');
         if (!$cID) {
             $cID = $request->request->get('cID');
         }
         $cID = Core::make('helper/security')->sanitizeInt($cID);
         if (!$cID) {
             $cID = 1;
         }
         $c = Page::getByID($cID, 'ACTIVE');
         $c->cPathFetchIsCanonical = true;
     }
     return $c;
 }
開發者ID:robertdamoc,項目名稱:concrete5,代碼行數:50,代碼來源:Page.php

示例3: loadError

 public function loadError($error)
 {
     return parent::loadError($error);
 }
開發者ID:BacLuc,項目名稱:newGryfiPage,代碼行數:4,代碼來源:__IDE_SYMBOLS__.php


注:本文中的Concrete\Core\Page\Page::loadError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。