|
@@ -21,6 +21,23 @@ class RouteBase {
|
|
|
die("default task not implemented");
|
|
die("default task not implemented");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function runTask($task) {
|
|
|
|
|
+ if (empty($task)) throw new Exception("Empty method name");
|
|
|
|
|
+ $methodName = "{$task}Action";
|
|
|
|
|
+ if (!method_exists($this, $methodName)) {
|
|
|
|
|
+ throw new Exception("Task '{$task}' not exists");
|
|
|
|
|
+ }
|
|
|
|
|
+ $this->{$methodName}();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public function runMethod($methodName) {
|
|
|
|
|
+ if (empty($methodName)) throw new Exception("Empty method name");
|
|
|
|
|
+ if (!method_exists($this, $methodName)) {
|
|
|
|
|
+ throw new Exception("Task '{$methodName}' not exists");
|
|
|
|
|
+ }
|
|
|
|
|
+ $this->{$methodName}();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function parseMessageFromStorageTestAction() {
|
|
public function parseMessageFromStorageTestAction() {
|
|
|
$msgs = V::get('msgs', '', $_GET);
|
|
$msgs = V::get('msgs', '', $_GET);
|
|
|
//echo $this->parseMessageFromStorage($msg);
|
|
//echo $this->parseMessageFromStorage($msg);
|