Different layout in administration

1. one-presenter administration, AdminPresenter.php

Handful for simple and small administration.

Directory structure

app/
    models/
    presenters/
        AdminPresenter.php
        BasePresenter.php
        HomepagePresenter.php
    templates/
        Admin/
            default.latte
        Homepage/
            default.latte
        @layout.latte       ← basic layout
        @layoutAdmin.latte  ← admin layout
    bootstrap.php

a) templates/Admin/default.latte

<!-- use adminLayout.latte -->
{layout "../@layoutAdmin.latte"}

b) or we can modify structure like this:

templates/
    Admin/
        default.latte
        @layout.latte
    Homepage/
        ...
    @layout.latte

and template Admin/@layout.latte will load for AdminPresenter.php automatically. See automatic layout loader

c) or AdminBasePresenter

We still have @layoutAdmin.latte as in variant A

abstract class AdminBasePresenter extends BasePresenter
{
    protected function beforeRender()
    {
        parent::beforeRender();
        $this->setLayout('layoutAdmin');
    }
}

2. Modules – Front & Admin

Divide application to two separated modules with their own @layout.latte.

See MVC Applications & Presenters