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


PHP ErrorPage::PageNotFoundRoute方法代码示例

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


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

示例1: Callback

 private function Callback()
 {
     $ElementsRoute = explode('/', $this->bindParamRoute[0]);
     $routePremier = $this->bindParamRoute[0];
     unset($this->bindParamRoute[0]);
     $NbElements = count($ElementsRoute);
     $urlParam = '';
     for ($i = 0; $i < $NbElements; $i++) {
         $urlParam .= $this->bindParamClient[$i] . '/';
         unset($this->bindParamClient[$i]);
     }
     $urlParam = substr($urlParam, 0, -1);
     if ($urlParam == $routePremier) {
         if (!empty($this->bindParamRoute) and !empty($this->bindParamClient)) {
             $this->param = [];
             if (count($this->bindParamRoute) == count($this->bindParamClient)) {
                 $this->param = array_combine($this->bindParamRoute, $this->bindParamClient);
             } else {
                 if ($this->ErrorPage == FALSE) {
                     // Aucune route trouvée
                     $this->ErrorPage = 'param';
                     require_once 'ErrorPageController.class.php';
                     $ErrorPage = new ErrorPage();
                     return $ErrorPage->PageNoParametersRoute();
                 }
             }
         }
         $this->FileExisted();
         $this->ClassExisted();
         $method = $this->method . 'Route';
         if (method_exists($this->classOn, $method)) {
             if (!empty($this->param) and is_array($this->param)) {
                 $viewparam = '';
                 foreach ($this->param as $paramdebug) {
                     $viewparam .= $paramdebug . '/';
                 }
                 $this->urlTerminal = '<span class="dpm">Route: <kbd>' . $routePremier . '</kbd></span> <span class="dpm">Parameters: <kbd>' . $viewparam . '</kbd></span> <span class="dpm">Controller: <kbd>' . $this->controller . '</kbd></span> <span class="dpm">Method: <kbd>' . $this->method . '</kbd></span>';
                 return $this->classOn->{$method}($this->param);
             } else {
                 $this->urlTerminal = '<span class="dpm">Route: <kbd>' . $routePremier . '</kbd></span> <span class="dpm">Parameters: <kbd>N/A</kbd></span> <span class="dpm">Controller: <kbd>' . $this->controller . '</kbd></span> <span class="dpm">Method: <kbd>' . $this->method . '</kbd></span>';
                 return $this->classOn->{$method}();
             }
         } else {
             if ($this->ErrorPage == FALSE) {
                 // Aucune route trouvée
                 $this->ErrorPage = '404';
                 require_once 'ErrorPageController.class.php';
                 $ErrorPage = new ErrorPage();
                 return $ErrorPage->PageNotFoundRoute();
             }
         }
     }
 }
开发者ID:jodevweb,项目名称:Fmkj,代码行数:53,代码来源:RouteController.class.php


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