- Added a new RenderRawView without the default HTML reponse
This commit is contained in:
parent
01bb926ca7
commit
434e3c0c46
|
@ -47,10 +47,15 @@ trait ControllerTrait {
|
|||
return $this->renderJson( array_filter($data ?? [], function($row) { return $row !== null; }));
|
||||
}
|
||||
|
||||
public function renderRawView(string $view, ?array $variables = null) : string
|
||||
{
|
||||
return $this->picea->renderHtml($view, $variables ?? [], $this);
|
||||
}
|
||||
|
||||
public function renderView(string $view, ?array $variables = null) : ResponseInterface
|
||||
{
|
||||
return static::renderHtml(
|
||||
$this->picea->renderHtml($view, $variables ?? [], $this)
|
||||
$this->renderRawView($view, $variables ?? [])
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,6 @@ class Routing {
|
|||
|
||||
foreach((array) ( $annotation->method ?? $annotation->methods ) as $method) {
|
||||
# Mapping every URLs from annotations in searched folders (Api, Controller, etc...)
|
||||
|
||||
$route->map(strtoupper($method), $annotation->getRoute(), function (ServerRequestInterface $request, array $arguments) use (
|
||||
$container, $route, $annotation
|
||||
) : ResponseInterface
|
||||
|
|
Loading…
Reference in New Issue