summaryrefslogtreecommitdiff
path: root/lib/router.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-02-11 00:45:11 -0500
committerEvan Prodromou <evan@controlyourself.ca>2009-02-11 00:45:11 -0500
commitbba1dbdb403aac067ae97c44531f6886f90fec35 (patch)
tree32ff8ae70721baf721ab4833acc2abfe7fff07c2 /lib/router.php
parentfbecbcb693e9d8fc810cf316e8739a22ac501043 (diff)
Use a router singleton
Diffstat (limited to 'lib/router.php')
-rw-r--r--lib/router.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/router.php b/lib/router.php
index 6443bf354..d47ad7118 100644
--- a/lib/router.php
+++ b/lib/router.php
@@ -48,6 +48,15 @@ require_once 'Net/URL/Mapper.php';
class Router
{
static $m = null;
+ static $inst = null;
+
+ static function get()
+ {
+ if (!Router::$inst) {
+ Router::$inst = new Router();
+ }
+ return Router::$inst;
+ }
function __construct()
{
@@ -344,7 +353,7 @@ class Router
$action_arg = array('action' => $action);
if ($args) {
- $args = array_merge($args, $action_arg);
+ $args = array_merge($action_arg, $args);
} else {
$args = $action_arg;
}