aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2011-09-24 12:59:49 +0200
committerKevin Chabowski <kevin@kch42.de>2011-09-24 12:59:49 +0200
commitdf88147d9bde725785e353bbf67d52608783204c (patch)
tree30733d680d6149ed83e8600ca516554a3df836b0
parenta77a00b175fcbc758cc6b9b1a546ecf3f5ab59ec (diff)
downloadratatoeskr-cms-df88147d9bde725785e353bbf67d52608783204c.tar.gz
ratatoeskr-cms-df88147d9bde725785e353bbf67d52608783204c.tar.bz2
ratatoeskr-cms-df88147d9bde725785e353bbf67d52608783204c.zip
Added speial URL action "_index".
-rw-r--r--ratatoeskr/sys/urlprocess.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/ratatoeskr/sys/urlprocess.php b/ratatoeskr/sys/urlprocess.php
index 42c4a4d..5c5b17b 100644
--- a/ratatoeskr/sys/urlprocess.php
+++ b/ratatoeskr/sys/urlprocess.php
@@ -87,6 +87,7 @@ function url_action_alias($for)
* Value is a callback of the form: function(&$data, $url_now, &$url_next). $data can be used for shared data between subactions. $url_next can be modified in order to redirect to another action / stop the routing.
*
* Special actions:
+ * _index - If name is empty, the index will be called.
* _default - If nothing was found, this is the default.
* _notfound - If not even _default exists or NotFoundError was thrown.
* _prelude - If existant, will be executed before everything else.
@@ -109,6 +110,8 @@ function url_process($url, $actions, &$data)
while(is_string($url_now) and ($url_now != "") and ($url_now != ".."))
{
$cb = NULL;
+ if(empty($url_now))
+ $url_now = "_index";
if(isset($actions[$url_now]))
$cb = $actions[$url_now];
else if(isset($actions["_default"]))