route : allow prerouting informations to be added in map comparisons
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2205 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -26,6 +26,8 @@ class route
|
||||
// Provide the the class catch errors in routing.
|
||||
// Must be provided in an array(class,method);
|
||||
public $errors = null;
|
||||
/** Preroute used in modules */
|
||||
public $preroute = "";
|
||||
|
||||
/** Return the baseURL of the site
|
||||
Always finish with a slash
|
||||
@@ -263,6 +265,7 @@ class route
|
||||
@param function $function Function to be executed if the route match */
|
||||
public function get ($route, $function)
|
||||
{
|
||||
$route = $this->preroute.$route;
|
||||
if ($this->debug)
|
||||
echo "<pre>==> GET $route ?? ";
|
||||
if ($this->method () !== "GET")
|
||||
@@ -284,6 +287,7 @@ class route
|
||||
@param function $function Function to be executed if the route match */
|
||||
public function post ($route, $function)
|
||||
{
|
||||
$route = $this->preroute.$route;
|
||||
if ($this->debug)
|
||||
echo "<pre>==> POST $route ?? ";
|
||||
if ($this->method () !== "POST")
|
||||
@@ -305,6 +309,7 @@ class route
|
||||
@param function $function Function to be executed if the route match */
|
||||
public function put ($route, $function)
|
||||
{
|
||||
$route = $this->preroute.$route;
|
||||
if ($this->debug)
|
||||
echo "<pre>==> PUT $route ?? ";
|
||||
if ($this->method () !== "PUT")
|
||||
@@ -326,6 +331,7 @@ class route
|
||||
@param function $function Function to be executed if the route match */
|
||||
public function delete ($route, $function)
|
||||
{
|
||||
$route = $this->preroute.$route;
|
||||
if ($this->debug)
|
||||
echo "<pre>==> DELETE $route ?? ";
|
||||
if ($this->method () !== "DELETE")
|
||||
|
||||
Reference in New Issue
Block a user