Easy backends with Symfony2 and the Sonata Admin bundle

30
Easy backends with Symfony2 and the SonataAdminBundle Lineke Kerckhoffs-Willems @the_linie / [email protected] http://joind.in/7062

description

Slides for the talk given at Symfony Live London on the 14th of September 2012

Transcript of Easy backends with Symfony2 and the Sonata Admin bundle

Page 1: Easy backends with Symfony2 and the Sonata Admin bundle

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

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

The problem

Page 4: Easy backends with Symfony2 and the Sonata Admin bundle

Solutions

!   DIY (Do It Yourself)

! Admingenerator bundle

!   SONATA ADMIN BUNDLE

Page 5: Easy backends with Symfony2 and the Sonata Admin bundle

The bundle

Page 6: Easy backends with Symfony2 and the Sonata Admin bundle

Setup

!   Installation

!   Separate bundle

Page 7: Easy backends with Symfony2 and the Sonata Admin bundle

Setup - Configuration

Page 8: Easy backends with Symfony2 and the Sonata Admin bundle

Admin class

Page 9: Easy backends with Symfony2 and the Sonata Admin bundle

Dashboard

Page 10: Easy backends with Symfony2 and the Sonata Admin bundle

Features

Page 11: Easy backends with Symfony2 and the Sonata Admin bundle

List view

Page 12: Easy backends with Symfony2 and the Sonata Admin bundle

Create / edit view

Page 13: Easy backends with Symfony2 and the Sonata Admin bundle

Fields - Relations - 1

Page 14: Easy backends with Symfony2 and the Sonata Admin bundle

Fields - Relations - 2

Page 15: Easy backends with Symfony2 and the Sonata Admin bundle

Validation In the admin class

Page 16: Easy backends with Symfony2 and the Sonata Admin bundle

A bit more advanced

Page 17: Easy backends with Symfony2 and the Sonata Admin bundle

Tooltips In the admin class

Page 18: Easy backends with Symfony2 and the Sonata Admin bundle

Adding filtering to list view

In the admin class

Page 19: Easy backends with Symfony2 and the Sonata Admin bundle

Default ordering in list view

In the admin class

Page 20: Easy backends with Symfony2 and the Sonata Admin bundle

Batch actions - 1

The user interface

Page 21: Easy backends with Symfony2 and the Sonata Admin bundle

Batch actions - 2

In the admin class

Page 22: Easy backends with Symfony2 and the Sonata Admin bundle

Batch actions - 3

Create a controller

Page 23: Easy backends with Symfony2 and the Sonata Admin bundle

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

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

Translations - domains

!   In the admin class

! Rename messages.<language>.xliff

Page 26: Easy backends with Symfony2 and the Sonata Admin bundle

There is more…

! Customize templates

!   ACL and Google authenticator

!   CLI

Page 27: Easy backends with Symfony2 and the Sonata Admin bundle

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

Questions?

Page 29: Easy backends with Symfony2 and the Sonata Admin bundle

Resources

!   http://sonata-project.org/

!   http://phpassionate.com/2012/05/22/how-to-use-the-symfony2-sonataadminbundle/

Page 30: Easy backends with Symfony2 and the Sonata Admin bundle

Thank you! http://joind.in/7062

@the_linie / [email protected]