Browse Source

detailed page template update

tags/0.1.0
Robin Thoni 9 years ago
parent
commit
c93e9714eb
1 changed files with 21 additions and 2 deletions
  1. 21
    2
      src/Doc/Business/LuDocBusiness.php

+ 21
- 2
src/Doc/Business/LuDocBusiness.php View File

146
 
146
 
147
         $reflection = new ReflectionMethod($business->getBusinessClass(), $business->getBusinessMethod());
147
         $reflection = new ReflectionMethod($business->getBusinessClass(), $business->getBusinessMethod());
148
         $description = $reflection->getDocComment();
148
         $description = $reflection->getDocComment();
149
+        $docParser = null;
149
         if ($description === false) {
150
         if ($description === false) {
150
             $description = "No description available";
151
             $description = "No description available";
151
         }
152
         }
154
             $description = $docParser->description;
155
             $description = $docParser->description;
155
         }
156
         }
156
 
157
 
158
+        $parameters = [];
159
+        foreach ($reflection->getParameters() as $param) {
160
+            $p = [];
161
+
162
+            $p["name"] = $param->getName();
163
+            if (!is_null($docParser) && isset($docParser->all_params[$param->getName()])) {
164
+                $p["description"] = $docParser->all_params[$param->getName()];
165
+                $p["type"] = "Unknown";
166
+                $p["annotations"] = "";
167
+            }
168
+            else {
169
+                $p["description"] = $description;
170
+                $p["type"] = "Unknown";
171
+                $p["annotations"] = "";
172
+            }
173
+
174
+            $parameters[] = $p;
175
+        }
157
 
176
 
158
         self::printTwig("method.html", array(
177
         self::printTwig("method.html", array(
159
-            "description" => $description,
178
+            "description" => str_replace("\n", "<br />", $description),
160
             "url" => $business->getUrl(),
179
             "url" => $business->getUrl(),
161
             "method" => $business->getMethod(),
180
             "method" => $business->getMethod(),
162
-            "parameters" => []));
181
+            "parameters" => $parameters));
163
     }
182
     }
164
 }
183
 }

Loading…
Cancel
Save