easy backends with symfony2 and the sonata admin bundle
DESCRIPTION
Slides for the talk given at Symfony Live London on the 14th of September 2012TRANSCRIPT
![Page 1: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/1.jpg)
Easy backends with Symfony2 and the
SonataAdminBundle
Lineke Kerckhoffs-Willems @the_linie / [email protected]
http://joind.in/7062
![Page 2: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/2.jpg)
About me
! Over 9 years experience with PHP
! Egeniq
! Love conferences
! Head of PHPWomen EU
! Lead developer ProTalk
! Mentor and writer
! Mum of 2 beautiful daughters
! @the_linie / [email protected]
![Page 3: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/3.jpg)
The problem
![Page 4: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/4.jpg)
Solutions
! DIY (Do It Yourself)
! Admingenerator bundle
! SONATA ADMIN BUNDLE
![Page 5: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/5.jpg)
The bundle
![Page 6: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/6.jpg)
Setup
! Installation
! Separate bundle
![Page 7: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/7.jpg)
Setup - Configuration
![Page 8: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/8.jpg)
Admin class
![Page 9: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/9.jpg)
Dashboard
![Page 10: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/10.jpg)
Features
![Page 11: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/11.jpg)
List view
![Page 12: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/12.jpg)
Create / edit view
![Page 13: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/13.jpg)
Fields - Relations - 1
![Page 14: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/14.jpg)
Fields - Relations - 2
![Page 15: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/15.jpg)
Validation In the admin class
![Page 16: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/16.jpg)
A bit more advanced
![Page 17: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/17.jpg)
Tooltips In the admin class
![Page 18: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/18.jpg)
Adding filtering to list view
In the admin class
![Page 19: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/19.jpg)
Default ordering in list view
In the admin class
![Page 20: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/20.jpg)
Batch actions - 1
The user interface
![Page 21: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/21.jpg)
Batch actions - 2
In the admin class
![Page 22: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/22.jpg)
Batch actions - 3
Create a controller
![Page 23: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/23.jpg)
Translations - simple
! Change default locale in parameters.ini
! Add messages.<language>.xliff in Resources/translations
![Page 24: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/24.jpg)
Translations - strategies
! Different strategies ! sonata.admin.label.strategy.native : DEFAULT
! sonata.admin.label.strategy.form_component
! sonata.admin.label.strategy.underscore
! sonata.admin.label.strategy.noop
! In config.yml
![Page 25: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/25.jpg)
Translations - domains
! In the admin class
! Rename messages.<language>.xliff
![Page 26: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/26.jpg)
There is more…
! Customize templates
! ACL and Google authenticator
! CLI
![Page 27: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/27.jpg)
Conclusion
! Sonata Admin Bundle is a great bundle
! Lack of / unclear documentation
! Complexity of the bundle
! Separate bundle needs controller directory
![Page 28: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/28.jpg)
Questions?
![Page 29: Easy backends with Symfony2 and the Sonata Admin bundle](https://reader031.vdocument.in/reader031/viewer/2022020207/549550b7b47959604d8b4d13/html5/thumbnails/29.jpg)
Resources
! http://sonata-project.org/
! http://phpassionate.com/2012/05/22/how-to-use-the-symfony2-sonataadminbundle/