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


PHP Error::index方法代码示例

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


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

示例1: error

 function error()
 {
     require 'controllers/' . EQ_404 . '.php';
     $error = new Error();
     $error->index();
     return false;
 }
开发者ID:eddythemeddy,项目名称:Equinox-CMS,代码行数:7,代码来源:Bootstrap.php

示例2: error

 function error()
 {
     require 'error.php';
     $controlador = new Error();
     $controlador->index();
     return false;
 }
开发者ID:sandyrod,项目名称:mimo,代码行数:7,代码来源:bootstrap.php

示例3: error

 public function error()
 {
     require 'controllers/error.php';
     $controller = new Error();
     $controller->index();
     return false;
 }
开发者ID:alibabaih,项目名称:notepad-php,代码行数:7,代码来源:bootstrap.php

示例4: error

 function error()
 {
     require "controller/error.php";
     $controller = new Error();
     $controller->index();
     return false;
 }
开发者ID:hrydi,项目名称:distro,代码行数:7,代码来源:Bootstrap.php

示例5: rtrim

 function __construct()
 {
     $url = filter_input(INPUT_GET, 'url');
     $url = rtrim($url, '/');
     $url = explode('/', $url);
     if (empty($url[0])) {
         require 'controllers/controllerIndex.php';
         $controller = new Index();
         $controller->index();
         return false;
     }
     $file = 'controllers/controller' . $url[0] . '.php';
     if (file_exists($file)) {
         require $file;
     } else {
         require 'controllers/controllerError.php';
         $controller = new Error();
         $controller->index($url[0]);
         return false;
     }
     $controller = new $url[0]();
     if (isset($url[1])) {
         if (method_exists($controller, $url[1])) {
             if (isset($url[2])) {
                 $controller->{$url[1]}($url[2]);
             } else {
                 $controller->{$url[1]}();
             }
         } else {
             $controller->index();
         }
     } else {
         $controller->index();
     }
 }
开发者ID:leal32b,项目名称:mvc,代码行数:35,代码来源:Bootstrap.php

示例6: error

 function error($msg = false)
 {
     require 'controllers/error.php';
     $error = new Error();
     $error->index($msg);
     return false;
 }
开发者ID:Rasulbek,项目名称:asiacinema,代码行数:7,代码来源:Start.php

示例7: __construct

 public function __construct()
 {
     $this->getUrlWithoutModRewrite();
     if (!$this->url_controller) {
         require APP . 'controllers/home.php';
         $page = new Home();
         $page->index();
     } elseif (file_exists(APP . 'controllers/' . $this->url_controller . '.php')) {
         require APP . 'controllers/' . $this->url_controller . '.php';
         $this->url_controller = new $this->url_controller();
         if (method_exists($this->url_controller, $this->url_action)) {
             if (!empty($this->url_params)) {
                 // Llama el metodo y le pasa los argumentos
                 call_user_func_array(array($this->url_controller, $this->url_action), $this->url_params);
             } else {
                 //Si no hay  parametros llama a el metodo sin argumentos.
                 $this->url_controller->{$this->url_action}();
             }
         } else {
             if (strlen($this->url_action) == 0) {
                 // Si no se define alguna accion defino por defecto la index
                 $this->url_controller->index();
             } else {
                 //Si la accion no existe lanzo el error
                 require APP . 'controllers/error.php';
                 $page = new Error();
                 $page->index();
             }
         }
     } else {
         require APP . 'controllers/error.php';
         $page = new Error();
         $page->index();
     }
 }
开发者ID:EmmanuelSW,项目名称:Eswood,代码行数:35,代码来源:application.php

示例8: isset

 function __construct()
 {
     $url = isset($_GET['url']) ? $_GET['url'] : null;
     $url = rtrim($url, "/");
     $url = explode("/", $url);
     if (empty($url[0])) {
         require '../controllers/index.php';
         $controller = new Index();
         $controller->index();
         return false;
     }
     // CONTROLLER
     // Only allow a controller name with dashes & alphanumeric characters
     if (preg_match('/[^0-9a-z-]/i', $url[0])) {
         require '../controllers/error.php';
         $controller = new Error("Invalid Character In Controller Name.");
         return false;
     }
     // For the script to read past this line, the controller must be alphanumeric w/ dash
     $file = '../controllers/' . $url[0] . '.php';
     if (file_exists($file)) {
         require $file;
     } else {
         // controller file not found
         // HOW CAN I LOG ERRORS HERE? PUT THEM INTO A DATABASE?
         require '../controllers/error.php';
         $controller = new Error("Controller not found: " . $url[0]);
         return false;
         //throw new Exception("The file '$file' does not exist!");
     }
     $controller = new $url[0]();
     $controller->loadModule($url[0]);
     // CALLING METHODS -------------------------------
     if (isset($url[2])) {
         // CHECK IF METHOD EXISTS
         if (method_exists($controller, $url[1])) {
             $controller->{$url[1]}($url[2]);
         } else {
             require '../controllers/error.php';
             $controller = new Error("Method not found: " . $url[1]);
         }
         return false;
     } elseif (isset($url[1])) {
         if (method_exists($controller, $url[1])) {
             $controller->{$url[1]}();
         } else {
             require '../controllers/error.php';
             $controller = new Error("Method not found: " . $url[1]);
         }
         return false;
     } else {
         $controller->index();
     }
 }
开发者ID:417solutions,项目名称:MVC-Files,代码行数:54,代码来源:libs-Bootstrap.php

示例9: isset

 function __construct()
 {
     $url = isset($_GET['url']) ? $_GET['url'] : null;
     $url = explode('/', $url);
     //print_r($url);
     //if empty redirect to index
     if (empty($url[0])) {
         require 'controllers/index.php';
         $controller = new Index();
         $controller->index();
         return false;
     }
     $file = 'controllers/' . $url[0] . '.php';
     if (file_exists($file)) {
         require $file;
         $controller = new $url[0]();
         if (isset($url[1])) {
             if ($url[1] == "") {
                 $controller->index();
             } else {
                 if (isset($url[2])) {
                     if ($url[2] == "") {
                         $controller->{$url}[1]();
                     } else {
                         $controller->{$url}[1]($url[2]);
                     }
                 } else {
                     if (method_exists($controller, $url[1])) {
                         //	$controller->index();
                         $controller->{$url}[1]();
                     } else {
                         require 'controllers/error.php';
                         $controller = new Error();
                         $controller->index();
                         return false;
                     }
                 }
             }
         }
         if (!isset($url[1])) {
             $controller->index();
         }
     } else {
         require 'controllers/error.php';
         $controller = new Error();
         $controller->index();
         return false;
     }
 }
开发者ID:ROCKY-SAM,项目名称:IOC,代码行数:49,代码来源:Bootstrap.php

示例10: __construct

 /**
  * "Start" the application:
  * Analyze the URL elements and calls the according controller/method or the fallback
  */
 public function __construct()
 {
     // create array with URL parts in $url
     $this->getUrlWithoutModRewrite();
     // check for controller: no controller given ? then load start-page
     if (!$this->url_controller) {
         require APP . 'controllers/home.php';
         $page = new Home();
         $page->index();
     } elseif (file_exists(APP . 'controllers/' . $this->url_controller . '.php')) {
         // here we did check for controller: does such a controller exist ?
         // if so, then load this file and create this controller
         // example: if controller would be "car", then this line would translate into: $this->car = new car();
         require APP . 'controllers/' . $this->url_controller . '.php';
         /**
          * Bad workaround due to list being a reserved keyword. Should probably rename to something other than list in production.
          **/
         if ($this->url_controller == 'list') {
             $this->url_controller = new days();
         } else {
             $this->url_controller = new $this->url_controller();
         }
         // check for method: does such a method exist in the controller ?
         if (method_exists($this->url_controller, $this->url_action)) {
             if (!empty($this->url_params)) {
                 // Call the method and pass arguments to it
                 call_user_func_array(array($this->url_controller, $this->url_action), $this->url_params);
             } else {
                 // If no parameters are given, just call the method without parameters, like $this->home->method();
                 $this->url_controller->{$this->url_action}();
             }
         } else {
             if (strlen($this->url_action) == 0) {
                 // no action defined: call the default index() method of a selected controller
                 $this->url_controller->index();
             } else {
                 // defined action not existent: show the error page
                 require APP . 'controllers/error.php';
                 $page = new Error();
                 $page->index();
             }
         }
     } else {
         require APP . 'controllers/error.php';
         $page = new Error();
         $page->index();
     }
 }
开发者ID:KealJones,项目名称:weather-data-crud-example,代码行数:52,代码来源:application.php

示例11: __construct

 /**
  * "Start" the application:
  * Analyze the URL elements and calls the according controller/method or the fallback
  */
 public function __construct()
 {
     // create array with URL parts in $url
     $this->getUrlWithoutModRewrite();
     $GLOBALS["beans"] = new stdClass();
     $this->openDatabaseConnection();
     $this->loadModels();
     $this->loadHelpers();
     date_default_timezone_set('UTC');
     // check for controller: no controller given ? then load start-page
     if (!$this->url_controller) {
         require APP . 'controllers/home.php';
         $page = new Home();
         $page->index();
     } elseif (file_exists(APP . 'controllers/' . $this->url_controller . '.php')) {
         // here we did check for controller: does such a controller exist ?
         // If user is not logged in, restrict to the login page only
         $this->checkLoggedIn();
         // if so, then load this file and create this controller
         // example: if controller would be "car", then this line would translate into: $this->car = new car();
         require APP . 'controllers/' . $this->url_controller . '.php';
         $this->url_controller = new $this->url_controller();
         // check for method: does such a method exist in the controller ?
         if (method_exists($this->url_controller, $this->url_action)) {
             if (!empty($this->url_params)) {
                 // Call the method and pass arguments to it
                 call_user_func_array(array($this->url_controller, $this->url_action), $this->url_params);
             } else {
                 // If no parameters are given, just call the method without parameters, like $this->home->method();
                 $this->url_controller->{$this->url_action}();
             }
         } else {
             if (strlen($this->url_action) == 0) {
                 // no action defined: call the default index() method of a selected controller
                 $this->url_controller->index();
             } else {
                 // defined action not existent: show the error page
                 require APP . 'controllers/error.php';
                 $page = new Error();
                 $page->index();
             }
         }
     } else {
         require APP . 'controllers/error.php';
         $page = new Error();
         $page->index();
     }
 }
开发者ID:divyabalakrishna,项目名称:CS428PNP,代码行数:52,代码来源:application.php

示例12: __construct

 /**
  * "Inicia" la aplicacion:
  * Analiza los elementos de la URL y pide el controlador/metodo
  */
 public function __construct()
 {
     $this->openDatabaseConnection();
     $url = $this->splitUrl();
     $cont = 0;
     if ($url[0] == 'gnhanoit') {
         require './application/libs/gnhanoit/gnhanoit.php';
         $gnhanoit = new gnhanoit();
         if (isset($url[0]) == true && isset($url[2]) == false) {
             $Table = $gnhanoit->index();
         } else {
             if (isset($url[0]) == true && isset($url[2]) == true && $url[2] == "crear") {
                 $gnhanoit->crear();
             }
         }
         require './application/libs/gnhanoit/vwgnhanoit.php';
         $cont = 1;
     }
     if ($cont == 0) {
         $this->url_controller = isset($url[0]) ? $url[0] : null;
         $this->url_action = isset($url[1]) ? $url[1] : null;
         if (file_exists('./application/controller/' . $this->url_controller . 'Controller.php')) {
             require './application/controller/' . $this->url_controller . 'Controller.php';
             $this->url_controller = new $this->url_controller();
             if (method_exists($this->url_controller, $this->url_action)) {
                 $parameter = array();
                 if (isset($url) == true && count($url) >= 3) {
                     for ($i = 2; $i < count($url); $i++) {
                         $parameter[] = $url[$i];
                     }
                     $this->url_controller->{$this->url_action}($parameter);
                 } else {
                     $this->url_controller->{$this->url_action}();
                 }
             } else {
                 $this->url_controller->index();
             }
         } else {
             require './application/controller/error.php';
             $home = new Error();
             $home->index();
         }
     }
 }
开发者ID:yohitan12,项目名称:fphanoit,代码行数:48,代码来源:fphanoit.php

示例13: createdb

 public function createdb()
 {
     require 'config/env.php';
     require 'config/database.php';
     $conn = mysqli_connect($dbhost, $dbusername, $dbpass);
     $sql = "CREATE DATABASE " . $dbname;
     if (mysqli_query($conn, $sql)) {
         echo '<script> alert("Database Created Sucessfully");</script>';
         $this->redirect();
     } else {
         require 'config/env.php';
         if ($debug = true) {
             require 'app/controllers/errorcontroller.php';
             $error = new Error();
             $error->index();
         } else {
         }
     }
 }
开发者ID:Andrew365,项目名称:PHP,代码行数:19,代码来源:authmodel.php

示例14: __construct

 /**
  * "Start" the application:
  * Analyze the URL elements and calls the according controller/method or the fallback
  */
 public function __construct()
 {
     // create array with URL parts in $url
     $this->splitUrl();
     // check for controller: no controller given ? then load start-page
     if (!$this->url_controller) {
         require APP . 'controller/home.php';
         $page = new Home();
         $page->index();
     } elseif (file_exists(APP . 'controller/' . $this->url_controller . '.php')) {
         // here we did check for controller: does such a controller exist ?
         // if so, then load this file and create this controller
         // example: if controller would be "car", then this line would translate into: $this->car = new car();
         require APP . 'controller/' . $this->url_controller . '.php';
         $this->url_controller = new $this->url_controller();
         // check for method: does such a method exist in the controller ?
         if (method_exists($this->url_controller, $this->url_action)) {
             if (!empty($this->url_params)) {
                 // Call the method and pass arguments to it
                 call_user_func_array(array($this->url_controller, $this->url_action), $this->url_params);
             } else {
                 // If no parameters are given, just call the method without parameters, like $this->home->method();
                 $this->url_controller->{$this->url_action}();
             }
         } else {
             if (strlen($this->url_action) == 0) {
                 // no action defined: call the default index() method of a selected controller
                 $this->url_controller->index();
             } else {
                 header('HTTP/1.0 404 Not Found');
                 require APP . 'controller/error.php';
                 $cont_error = new Error("Esa acción no existe");
                 $cont_error->index();
             }
         }
     } else {
         header('HTTP/1.0 404 Not Found');
         require APP . 'controller/error.php';
         $cont_error = new Error("Ese controlador no existe");
         $cont_error->index();
     }
 }
开发者ID:cmabris,项目名称:miniDWES,代码行数:46,代码来源:application.php

示例15: load_controller

 /**
  * Controller betöltése
  */
 private function load_controller()
 {
     // Először is betölti a megfelelő controller fájlt (ha betölthető), az url első paramétere alapján.
     $file = 'system/' . $this->registry->area . '/controller/' . $this->registry->controller . '.php';
     if (!file_exists($file)) {
         require_once 'system/' . $this->registry->area . '/controller/error.php';
         $error = new Error();
         $error->index();
     } else {
         require_once $file;
         // Példányosítjuk a controllert
         $controller = new $this->registry->controller();
         // meghívjuk az action metódust, ha nincs, akkor az index metódust hívjuk meg
         if (method_exists($controller, $this->registry->action)) {
             $controller->{$this->registry->action}();
         } else {
             $controller->index();
         }
     }
 }
开发者ID:hillmediakft,项目名称:multijob,代码行数:23,代码来源:application.php


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