mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
add doc about menu bundle
This commit is contained in:
parent
40a2692c9c
commit
df160858e9
38
docs/admin_menu.md
Normal file
38
docs/admin_menu.md
Normal file
@ -0,0 +1,38 @@
|
||||
On utilise les options de routing pour créer des entrées.
|
||||
|
||||
```yaml
|
||||
chill_appointment_admin:
|
||||
pattern: /admin
|
||||
defaults: { _controller: CLChillAppointmentBundle:Admin:index }
|
||||
options:
|
||||
menu: admin
|
||||
label: menu.Appointment.index.title
|
||||
helper: menu.Appointment.index.helper
|
||||
order: 200
|
||||
```
|
||||
|
||||
Attention à ne pas utiliser deux fois le même `order`, sinon l'entrée est supprimée...
|
||||
|
||||
Et puis, il "suffit" de créer la fonction correspondante dans un controller.
|
||||
|
||||
On peut se contenter d'un "forward" vers la fonction index du controller admin dans le bundle main ('CLChillMainBundle:Controller:index') :
|
||||
|
||||
```php
|
||||
public function indexAction() {
|
||||
return $this->forward('CLChillMainBundle:Admin:index',
|
||||
array(
|
||||
'menu' => 'admin_appointment',
|
||||
'page_title' => 'menu.appointment.admin.index',
|
||||
'header_title' => 'menu.appointment.header_index'
|
||||
)
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
qui ira chercher à son tour toutes les entrées ont comme option le menu correspondant. Exemple pour admin_appointment:
|
||||
|
||||
```yaml
|
||||
options:
|
||||
menu: admin_appointment
|
||||
#(...)
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user