diff --git a/asset/lean-api/js/api-console.js b/asset/lean-api/js/api-console.js new file mode 100644 index 0000000..ae54cd5 --- /dev/null +++ b/asset/lean-api/js/api-console.js @@ -0,0 +1,7 @@ +class ApiConsole { + constructor(options) { + + } + + +} \ No newline at end of file diff --git a/src/RouteDescriptor.php b/src/RouteDescriptor.php index 9db4e8d..db6ef9c 100644 --- a/src/RouteDescriptor.php +++ b/src/RouteDescriptor.php @@ -9,14 +9,6 @@ use Picea\Extension\UrlExtension; class RouteDescriptor { - public string $routeLine = << - %s - %s - %s - %s - -HTML; - public function __construct( public object $controller, protected UrlExtension $urlExtension, @@ -45,7 +37,7 @@ HTML; 'path' => $base.$path, 'cleaned' => $cleaned, 'description'=> $route->description, - 'methods' =>implode(', ', (array)$route->method), + 'methods' => $route->method, ]; } } diff --git a/view/lean-api/route_descriptor.phtml b/view/lean-api/route_descriptor.phtml index 86143ef..1537953 100644 --- a/view/lean-api/route_descriptor.phtml +++ b/view/lean-api/route_descriptor.phtml @@ -1,9 +1,31 @@ +{% function printMethods(array|string $methods) %} + {% foreach (array) $methods as $method %} + {{ $method }} + {% endforeach %} +{% endfunction %} + \ No newline at end of file + + +
+ + +
+ {% ui:textarea "body" %} +
+
+
+
+ + \ No newline at end of file diff --git a/view/lean/layout/docs.phtml b/view/lean/layout/docs.phtml index f16cb2b..81f2a83 100644 --- a/view/lean/layout/docs.phtml +++ b/view/lean/layout/docs.phtml @@ -31,6 +31,8 @@ ol .title { display: flex;justify-content: space-between;background: #ffffffb2;padding: 9px 5px;border: 1px solid #fff;} .field-desc > div {padding:5px;} + .api-console {padding:20px 15px;border:1px solid #aeaeae;border-left-width: 5px;background:#ccc} + .forms ol {background: #ccdef2;} .forms li {border-color: #859aae;} .forms .form-name {background: #9cc5e6;color: #284168;font-size:110%}