The contents of the navbar and sidebar are separated into components, following an event driven approach.
The general process to use a particular component is to create an event listener and to use the given event object to add ui elements.
Each component has its own event and specific ui data interfaces.
Since most of the components do genereate one or two specific links (e.g. task list and task details) the specific routes must be rigged with the option avanzu_admin_route
which defines the alias name like so:
# routing.yml
avanzu_admin_home:
path: /demo-admin/
defaults: {_controller: AvanzuAdminThemeBundle:Default:index}
options:
avanzu_admin_route: welcome
"Single item" Routes which point to a particular data item all use the parameter ident
which is defined by the items getIdentifier()
- welcome
- Used for the "homepage" within the theme
- profile
- Used for the current user's profile
- logout
- The logout route
- all_tasks
- Used to generate the task list link
- task
- Used to generate a link to a specific task. *(single item)*
- all_notifications
- Used to generate the notification list link
- notification
- Used to generate a link to a specific notification. *(single item)*
- all_messages
- generates the message list link
- message
- Used to generate a link to a specific message. *(single item)*
- Navbar User
- Navbar Tasks
- Navbar Notifications
- Navbar Messages
- Sidebar User
- Sidebar Search
- Sidebar Navigation
- Breadcrumb Menu
In order to see some working examples, the bundle comes with a demo implementation for each component.
# config.yml
avanzu_admin_theme:
enable_demo: true
and add the routes to your routing configuration:
# routing.yml
avanzu_admin:
prefix: /admin # or whichever you like
resource: "@AvanzuAdminThemeBundle/Resources/config/routes.yml"