In Zend Expressive, the layout is "default" into "templates" folder.
I would like to add "admin" folder into "templates" folder like that:
- Templates
- admin
- app
- admin-page.phtml
- error
- 404.phtml
- error.phtml
- layout
- default.phtml
- app
- default
- app
- home-page.phtml
- error
- 404.phtml
- error.phtml
- layout
- default.phtml
- app
- admin
I've tried with the tutorials of Zend expressive to add new layout but no success for me...
class AdminPageHandler implements RequestHandlerInterface
{
private $template;
public function __construct(TemplateRendererInterface $template)
{
$this->template = $template;
}
public function handle(ServerRequestInterface $request) : ResponseInterface
{
$data = [
'admin' => 'layout::admin',
// or 'layout::admin',
// or 'layout::alternative',
];
$content = $this->template->render('pages::admin-page', $data);
return new HtmlResponse($content);
}
}
How can I add a new layout for my admin dashboard?
I would like to add new layout for my admin dashboard because the HTML script is different of my Home Application.