Explorar o código

added RouteBase

Piotr Labudda %!s(int64=9) %!d(string=hai) anos
pai
achega
0f6bfffa98
Modificáronse 1 ficheiros con 22 adicións e 0 borrados
  1. 22 0
      SE/se-lib/RouteBase.php

+ 22 - 0
SE/se-lib/RouteBase.php

@@ -94,6 +94,28 @@ class RouteBase {
 		User::authByRequest();
 	}
 
+	public function menu() {
+		$getLink = array($this, 'getLink');
+		echo UI::h('ul', [], array_map(
+			function ($method) use ($getLink) {
+				$action = substr($method, 0, -6);
+				return UI::h('li', [],
+					UI::h('a', [
+						'href' => $getLink($action)
+					], $action)
+				);
+			}
+			, array_filter(
+				get_class_methods($this)
+				, function ($method) {
+					if ('Action' != substr($method, -6)) return false;
+					if ('parseMessageFromStorageTestAction' == $method) return false;
+					return true;
+				}
+			)
+		));
+	}
+
 	public function reinstall() {
 		$clsName = get_class($this);
 		if ('Route_UrlAction' == substr($clsName, 0, strlen('Route_UrlAction'))) {