elao / admin-theme-bundle
Twig template set for elao-admin
Installs: 6 812
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 8
Forks: 0
Open Issues: 1
Language:Twig
Type:symfony-bundle
Requires
- php: ^8.0
- symfony/config: ^4.4|^5.0|^6.0
- symfony/dependency-injection: ^4.4|^5.0|^6.0
- symfony/http-foundation: ^4.4|^5.0|^6.0
- symfony/routing: ^4.4|^5.0|^6.0
- twig/twig: ^2.12|^3.0
Requires (Dev)
- symfony/console: ^5.1|^6.0
- symfony/filesystem: ^5.1|^6.0
- symfony/finder: ^5.1|^6.0
- symfony/twig-bridge: ^5.1|^6.0
This package is auto-updated.
Last update: 2024-10-19 10:48:52 UTC
README
Twig template set for elao-admin
Installation
composer require elao/admin-theme-bundle
Usage
Yourbase template should extends elao admin theme base:
{# template/base.html.twig #} {% extends '@ElaoAdminTheme/base.html.twig' %} {# HEAD #} {% block stylesheets %} {{ encore_entry_link_tags('app') }} {% endblock %} {% block javascripts %} {{ encore_entry_script_tags('app') }} {% endblock %} {% block title 'Demo Admin' %} {% block logo 'Demo' %} {# MENUS #} {% set menu_user = [ { route: 'profile', label: 'Profil' }, { url: '/logout', label: 'Déconnexion' }, ] %} {% set menu_primary = [ { route: 'user_list', label: 'Utilisateurs', root: 'user', icon: 'user' }, { route: 'bill_list', label: 'Factures', icon: 'bill' }, ] %} {# MOBILE MENU #} {% set menu_mobile = [ { label: 'Utilisateurs', root: 'user', children: [ { label: 'Liste des utilisateurs', branch: 'user_list', children: [ { route: 'user_list', label: 'Tous les utilisateurs' }, { route: 'user_list_archived', label: 'Utilisateurs archivés' }, ] }, { route: 'user_create', label: 'Nouvel utilisateur' }, ] }, { label: 'Factures', route: 'bill_list' }, { label: 'Profil', route: 'profile', }, { label: 'Déconnexion', url: '/logout', }, ] %}
Page
{# templte/user/base.html.twig #} {% extends 'base.html.twig' %} {% set menu_secondary = [ { route: 'user_list', label: 'Liste des utilisateurs', branch: 'user_list' }, { route: 'user_create', label: 'Nouvel utilisateur', icon: 'plus' }, ]%}
{# templte/user/list.html.twig #} {% extends 'user/base.html.twig' %} {% block title %}Utilisateurs{% endblock %} {% set menu_tertiary = [ { route: 'user_list', label: 'Tous les utilisateurs' }, { route: 'user_list_archived', label: 'Utilisateurs archivés' }, ]%} {% block page_content %} <div class="container"> {# ... #} </div> {% endblock %}
Drop
{% embed "@ElaoAdminTheme/components/drop.html.twig" with { menu: [ { url: '#show', label: 'Consulter' }, { url: '#edit', label: 'Éditer' }, { url: '#delete', label: 'Supprimer' }, ] } only %} {% block drop_direction 'left' %} {% block tooltip_direction 'top' %} {% block tooltip_label 'Choisir une action' %} {% endembed %}