From 1e08d34f64347bb7e4b66708bc53723e415572cb Mon Sep 17 00:00:00 2001 From: Thomas Chemineau Date: Thu, 16 Jan 2014 14:28:05 +0100 Subject: [PATCH 1/2] add a global variable to store filter --- lib/Textpress/Textpress.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Textpress/Textpress.php b/lib/Textpress/Textpress.php index ff0573b..e09c29e 100755 --- a/lib/Textpress/Textpress.php +++ b/lib/Textpress/Textpress.php @@ -447,6 +447,10 @@ public function setRoutes() case 'category' : case 'tag' : $self->filterArticles($key,$args[0]); + $self->slim->view()->appendGlobalData(array('filter' => array( + 'type' => $key, + 'value' => $args[0] + ))); break; // If key is not matched, check if a custom function is declared From 097d47e38c6548f0a3e4d5d504dd54a72c289075 Mon Sep 17 00:00:00 2001 From: Thomas Chemineau Date: Thu, 16 Jan 2014 18:49:57 +0100 Subject: [PATCH 2/2] pass url arguments to custom functions --- lib/Textpress/Textpress.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Textpress/Textpress.php b/lib/Textpress/Textpress.php index e09c29e..5dcd354 100755 --- a/lib/Textpress/Textpress.php +++ b/lib/Textpress/Textpress.php @@ -456,7 +456,7 @@ public function setRoutes() // If key is not matched, check if a custom function is declared default: if ($custom && is_callable($custom)) - call_user_func($custom, $self, $key, $value); + call_user_func($custom, $self, $key, $value, $args); break; }