|
@@ -26,7 +26,6 @@ class LuDocBusiness
|
26
|
26
|
|
27
|
27
|
$route = LuRoute::getInstance();
|
28
|
28
|
$route->get("$prefix/doc", "${ns}LuDocBusiness", "index");
|
29
|
|
- $route->get("$prefix/doc/{businessHyphen}", "${ns}LuDocBusiness", "business");
|
30
|
29
|
$route->get("$prefix/doc/{businessHyphen}/{method}", "${ns}LuDocBusiness", "method");
|
31
|
30
|
}
|
32
|
31
|
|
|
@@ -82,47 +81,32 @@ class LuDocBusiness
|
82
|
81
|
/**
|
83
|
82
|
* @var $businesses LuRouteDbo[]
|
84
|
83
|
*/
|
85
|
|
-
|
86
|
|
- $loader = new Twig_Loader_Filesystem(__DIR__ . "/../Templates");
|
87
|
|
- $twig = new Twig_Environment($loader, array());
|
88
|
|
- $template = $twig->loadTemplate("index.html.twig");
|
89
|
|
- $content = $template->render(array());
|
90
|
|
- echo $content;
|
91
|
|
-
|
92
|
|
- /*foreach ($businesses_ as $businesses) {
|
|
84
|
+ $businesses_tiwg = [];
|
|
85
|
+ foreach ($businesses_ as $businesses) {
|
93
|
86
|
$businessHyphen = self::getBusinessHyphen($businesses[0]->getBusinessClass());
|
94
|
87
|
$businessName = self::getBusinessName($businesses[0]->getBusinessClass());
|
95
|
|
- echo '<a href="doc/' . $businessHyphen . '"><h1>' . $businessName . "</h1></a>";
|
|
88
|
+ $business_tiwg = [];
|
|
89
|
+ $business_tiwg["name"] = $businessName;
|
|
90
|
+ $business_tiwg["name_hyphen"] = $businessHyphen;
|
|
91
|
+ $business_tiwg["routes"] = [];
|
96
|
92
|
|
97
|
93
|
foreach ($businesses as $business) {
|
98
|
|
- echo '<a href="doc/' . $businessHyphen . '/' . $business->getBusinessMethod()
|
99
|
|
- . '">' . $business->getMethod() . " " . $business->getUrl() . "</a><br />";
|
|
94
|
+ $business_tiwg["routes"][] = [
|
|
95
|
+ "method" => $business->getMethod(),
|
|
96
|
+ "url" => $business->getUrl(),
|
|
97
|
+ "businessMethod" => $business->getBusinessMethod()
|
|
98
|
+ ];
|
100
|
99
|
}
|
101
|
|
- }*/
|
102
|
|
- exit;
|
103
|
|
- }
|
|
100
|
+ $businesses_tiwg[] = $business_tiwg;
|
|
101
|
+ }
|
104
|
102
|
|
|
103
|
+ $loader = new Twig_Loader_Filesystem(__DIR__ . "/../Templates");
|
|
104
|
+ $twig = new Twig_Environment($loader, array());
|
|
105
|
+ $template = $twig->loadTemplate("index.html.twig");
|
|
106
|
+ $content = $template->render(array("businesses" => $businesses_tiwg));
|
|
107
|
+ echo $content;
|
105
|
108
|
|
106
|
|
- /**
|
107
|
|
- * Print the help page for the selected business.
|
108
|
|
- * The business must have the full namespace, hyphen separated
|
109
|
|
- * eg: App-Http-Business-MyBusinessClass
|
110
|
|
- * @param $businessHyphen string The business to print help
|
111
|
|
- */
|
112
|
|
- public static function business($businessHyphen)
|
113
|
|
- {
|
114
|
|
- $businesses_ = self::getBusinesses();
|
115
|
|
- /**
|
116
|
|
- * @var $businesses LuRouteDbo[]
|
117
|
|
- */
|
118
|
|
- $businesses = $businesses_[self::getBusinessFromHyphen($businessHyphen)];
|
119
|
|
- $businessName = self::getBusinessName($businesses[0]->getBusinessClass());
|
120
|
|
- echo '<a href="' . $businessHyphen . '"><h1>' . $businessName . "</h1></a>";
|
121
|
109
|
|
122
|
|
- foreach ($businesses as $business) {
|
123
|
|
- echo '<a href="' . $businessHyphen . '/' . $business->getBusinessMethod()
|
124
|
|
- . '">' . $business->getMethod() . " " . $business->getUrl() . "</a><br />";
|
125
|
|
- }
|
126
|
110
|
exit;
|
127
|
111
|
}
|
128
|
112
|
|