route : Return to standard class : not not needed static

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1824 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2014-09-16 12:57:18 +00:00
parent d5aefa2b09
commit 41e8a4a876

View File

@@ -21,7 +21,7 @@ class route
public $debug=0;
//public $defaultOutput = "html"; // Default renderer : html
// Provide the static class::method to errors in routing.
// Provide the the class catch errors in routing.
// Must be provided in an array(class,method);
public $errors = null;
@@ -606,11 +606,17 @@ class route
// If an error class/method is defined, use it in place of the default
// one.
// The error method must be a "static public function"
// The errors must be defined in an array ("class", "method");
// The errors must be defined in an array("class", "method");
if ($this->errors !== null)
{
forward_static_call($this->errors, $getCode, $e->getMessage());
if (! is_array ($this->errors))
die ("The route::\$errors is not an array\n");
if (! isset ($this->errors[0]) || ! isset ($this->errors[1]))
die ("The route::\$errors is not correct : must be the class and ".
"the method in an array\n");
$a = new $this->errors[0];
$method = $this->errors[1];
$a->$method ($getCode, $e->getMessage());
exit;
}