当前位置: 首页>>代码示例>>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;未经允许,请勿转载。