aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Request.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-08-12 20:59:27 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-08-12 21:01:07 +0200
commit1b20f6bd025a08a7a741b2751d837f736758eb2d (patch)
tree1fd655b215eff8301a0e932e07eb740f864a3883 /lib/Minz/Request.php
parent8ffd59f34ac458827f2a0217e4630caf69705853 (diff)
New wrappers Minz_Request::good() and bad()
1. Set a notification message in session variable 2. Redirect to a specific url First use in importExportController.php See https://github.com/marienfressinaud/FreshRSS/conversations/576
Diffstat (limited to 'lib/Minz/Request.php')
-rw-r--r--lib/Minz/Request.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php
index 755784522..2f745a04c 100644
--- a/lib/Minz/Request.php
+++ b/lib/Minz/Request.php
@@ -146,6 +146,31 @@ class Minz_Request {
}
}
+
+ /**
+ * Wrappers good notifications + redirection
+ * @param $msg notification content
+ * @param $url url array to where we should be forwarded
+ */
+ public static function good($msg, $url = array()) {
+ Minz_Session::_param('notification', array(
+ 'type' => 'good',
+ 'content' => $msg
+ ));
+
+ Minz_Request::forward($url, true);
+ }
+
+ public static function bad($msg, $url = array()) {
+ Minz_Session::_param('notification', array(
+ 'type' => 'bad',
+ 'content' => $msg
+ ));
+
+ Minz_Request::forward($url, true);
+ }
+
+
/**
* Permet de récupérer une variable de type $_GET
* @param $param nom de la variable