- Work done to clarify a bit every section, and a hugh code refractoring also was made to the code base.
This commit is contained in:
1 parent
a98e46c343
commit
6b655bdc76
15 files changed
+260
-145
No files matched your search
+11
-7
@@ -8,6 +8,8 @@ use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
trait LeanApiTrait
|
||||
{
|
||||
use DescriptorTrait;
|
||||
|
||||
#[Ignore]
|
||||
public function renderMarkdown(string $filepath, array $entities = [], array $forms = [], int $code = 200, array $headers = []) : ResponseInterface
|
||||
{
|
||||
@@ -19,21 +21,23 @@ trait LeanApiTrait
|
||||
|
||||
if (str_contains($markdown, '{route:descriptor}'))
|
||||
{
|
||||
$describe = (new RouteDescriptor($this, $this->picea->compiler->getExtensionFromToken('url')))->describe();
|
||||
$markdown = str_replace('{route:descriptor}', $describe, $markdown);
|
||||
$markdown = str_replace('{route:descriptor}', $this->renderRawView('lean-api/route_descriptor', [
|
||||
'routes' => (new RouteDescriptor($this, $this->picea->compiler->getExtensionFromToken('url')))->getRoutes()
|
||||
]), $markdown);
|
||||
}
|
||||
|
||||
if (str_contains($markdown, '{entity:descriptor}'))
|
||||
{
|
||||
$describe = (new EntityDescriptor())->describe(... $entities);
|
||||
$markdown = str_replace('{entity:descriptor}', $describe, $markdown);
|
||||
$markdown = str_replace('{entity:descriptor}', $this->renderRawView('lean-api/entity_descriptor', [
|
||||
'entities' => (new EntityDescriptor())->getEntities(... $entities)
|
||||
]), $markdown);
|
||||
}
|
||||
|
||||
|
||||
if (str_contains($markdown, '{form:descriptor}'))
|
||||
{
|
||||
$describe = (new FormDescriptor())->describe(... $forms);
|
||||
$markdown = str_replace('{form:descriptor}', $describe, $markdown);
|
||||
$markdown = str_replace('{form:descriptor}', $this->renderRawView('lean-api/form_descriptor', [
|
||||
'forms' => (new FormDescriptor())->getForms(... $forms)
|
||||
]), $markdown);
|
||||
}
|
||||
|
||||
return $this->renderView("lean/layout/docs", get_defined_vars());
|
||||
|
||||
Reference in new issue
Block a user