Different layout in administration 24/04/2015
One-presenter administration, AdminPresenter.php Handful for simple and small administration.
Directory structure <b>app/ models/ presenters/ AdminPresenter.php BasePresenter.php HomepagePresenter.php templates/ Admin/ default.latte Homepage/ default.latte @layout.latte</b> ← basic layout <b>@layoutAdmin.latte</b> ← admin layout <b>bootstrap.php</b> templates/Admin/default.latte
<!-- use adminLayout.latte --> {layout "../@layoutAdmin.latte"} or we can modify structure like this:
<b>templates/ Admin/ default.latte @layout.latte Homepage/</b> ... <b>@layout.latte</b> and template Admin/@layout.latte will load for AdminPresenter.php automatically. See automatic layout loader
or AdminBasePresenter
One-presenter administration, AdminPresenter.php
Handful for simple and small administration.
Directory structure
<b>app/
models/
presenters/
AdminPresenter.php
BasePresenter.php
HomepagePresenter.php
templates/
Admin/
default.latte
Homepage/
default.latte
@layout.latte</b> ← basic layout
<b>@layoutAdmin.latte</b> ← admin layout
<b>bootstrap.php</b>
templates/Admin/default.latte
<!-- use adminLayout.latte --> {layout "../@layoutAdmin.latte"}
or we can modify structure like this:
<b>templates/ Admin/ default.latte @layout.latte Homepage/</b> ... <b>@layout.latte</b>
and template
Admin/@layout.latte
will load forAdminPresenter.php
automatically. See automatic layout loaderor
AdminBasePresenter
We still have
@layoutAdmin.latte
as in variant 1abstract class AdminBasePresenter extends BasePresenter { protected function beforeRender() { parent::beforeRender(); $this->setLayout('layoutAdmin'); } }
Modules – Front & Admin
Divide application to two separated modules with their own @layout.latte
.