Skip to content

marko/admin-panel-twig

Twig templates for marko/admin-panel --- provides the login, dashboard, layout, and partial views rendered by the Twig engine. Installing this package is all that is needed to supply admin panel templates when using marko/view-twig; no additional configuration is required.

Terminal window
composer require marko/admin-panel-twig

Requires marko/admin-panel and marko/view-twig.

Install the package alongside marko/admin-panel and marko/view-twig:

Terminal window
composer require marko/admin-panel marko/admin-panel-twig marko/view-twig

Templates are discovered automatically via the extra.marko.templates_for declaration in the package’s composer.json. The admin-panel:: template namespace resolves to the views in this package --- for example, admin-panel::dashboard/index renders resources/views/dashboard/index.twig.

Template nameFile
admin-panel::auth/loginresources/views/auth/login.twig
admin-panel::layout/baseresources/views/layout/base.twig
admin-panel::dashboard/indexresources/views/dashboard/index.twig
admin-panel::partials/sidebarresources/views/partials/sidebar.twig
admin-panel::partials/flashresources/views/partials/flash.twig

Override any template by placing a file with the same path under your own module’s resources/views/admin-panel/ directory:

mymodule/
resources/
views/
admin-panel/
dashboard/
index.twig # Overrides the default dashboard