routeSQL : Allow to put the parameters in any order
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2002 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -144,12 +144,17 @@ class routeSQL
|
|||||||
$route->redirect ("/".$this->url_prefix, "");
|
$route->redirect ("/".$this->url_prefix, "");
|
||||||
});
|
});
|
||||||
|
|
||||||
$route->get ($this->url_prefix."(\?(page={page})?&?(num={num})?)?",
|
$route->get ($this->url_prefix."(\?({p1}={v1})(&{p2}={v2})?)?",
|
||||||
function ($page, $num) use ($route)
|
function ($p1, $v1, $p2, $v2) use ($route)
|
||||||
{
|
{
|
||||||
// LIST ALL THE OBJECTS OF THE TABLE
|
// LIST ALL THE OBJECTS OF THE TABLE
|
||||||
// num is the number of elements displayed by page
|
// num is the number of elements displayed by page
|
||||||
// page is the page to display
|
// page is the page to display
|
||||||
|
// Allow the parameters to be sent in any order
|
||||||
|
if ($p1 === "num") $num = $v1;
|
||||||
|
if ($p2 === "num") $num = $v2;
|
||||||
|
if ($p1 === "page") $page = $v1;
|
||||||
|
if ($p2 === "page") $page = $v2;
|
||||||
$this->connect();
|
$this->connect();
|
||||||
$csrf = new csrf ();
|
$csrf = new csrf ();
|
||||||
$token = $csrf->createToken ();
|
$token = $csrf->createToken ();
|
||||||
|
|||||||
Reference in New Issue
Block a user