SlideShare una empresa de Scribd logo
1 de 52
Symfony workshop
                             Stefan Koopmanschap




zondag 10 oktober 2010
Welcome



zondag 10 oktober 2010
Today

                    • Frameworks
                    • The symfony framework
                    • Developing with symfony
                    • Our project for today

zondag 10 oktober 2010
Introduction
                    • Stefan Koopmanschap
                    • Software Engineer
                    • Consultant
                    • Trainer
                    • Community Manager
                    • PHPBenelux secretary
zondag 10 oktober 2010
Frameworks



zondag 10 oktober 2010
Application




zondag 10 oktober 2010
Application
                         Framework




zondag 10 oktober 2010
Application             Application   Application
                          Framework




zondag 10 oktober 2010
symfony



zondag 10 oktober 2010
symfony

                    • full stack
                    • highly configurable
                    • minimizes boring tasks
                    • maximizes focus on important stuff

zondag 10 oktober 2010
symfony


                    • MVC
                    • ORM


zondag 10 oktober 2010
Today: symfony 1.4



zondag 10 oktober 2010
Developing with symfony


                    • symfony
                    • PHP and a webserver (and a database)
                    • command line
                    • IDE

zondag 10 oktober 2010
Our project for today

                    • Users
                    • Friends
                    • Updates
                    • API

zondag 10 oktober 2010
Gesichtbuch



zondag 10 oktober 2010
zondag 10 oktober 2010
Structure



zondag 10 oktober 2010
Project
                           Application
                            Module

                            Module


                           Application
                            Module

                            Module



                          Plugin




zondag 10 oktober 2010
Plugins



zondag 10 oktober 2010
Plugins

                    • reusable sets of functionality
                     • modules
                     • libraries
                     • anything that can be re-used

zondag 10 oktober 2010
Plugins

                    • On the symfony site:
                     • 1142 plugins
                     • 475 contributes
                    • Github
                    • Individual websites

zondag 10 oktober 2010
sfDoctrineGuardPlugin

                    • Authentication
                    • Authorization
                    • User management


zondag 10 oktober 2010
zondag 10 oktober 2010
The database



zondag 10 oktober 2010
Database

                    • ORMs
                     • Propel
                     • Doctrine
                     • Custom

zondag 10 oktober 2010
ORMs vs Models



zondag 10 oktober 2010
zondag 10 oktober 2010
Modules



zondag 10 oktober 2010
Modules

                    • Heart of your application
                     • handle page-specific logic
                     • contain page-specific display logic
                     • call the model

zondag 10 oktober 2010
Modules

                    • Different types
                     • “blank” modules
                     • CRUD modules
                     • admin generator

zondag 10 oktober 2010
zondag 10 oktober 2010
Forms



zondag 10 oktober 2010
Forms

                    • Extensive integrated form framework
                     • Form generation
                     • Form validation
                     • Form processing

zondag 10 oktober 2010
zondag 10 oktober 2010
Models



zondag 10 oktober 2010
Controller


                         Model                View




zondag 10 oktober 2010
Models

                    • Business logic
                     • calculations
                     • database transactions


zondag 10 oktober 2010
zondag 10 oktober 2010
The mailer



zondag 10 oktober 2010
The mailer

                    • mail()
                    • opening sockets
                    • swiftMailer


zondag 10 oktober 2010
zondag 10 oktober 2010
Caching



zondag 10 oktober 2010
Caching

                    • Improve performance
                    • Don’t repeat “slow” data fetching
                    • Caching does not fix the problem!


zondag 10 oktober 2010
Caching in symfony


                    • Configuration mostly
                    • Coding is possible


zondag 10 oktober 2010
zondag 10 oktober 2010
Routing



zondag 10 oktober 2010
Routing

                    • gesichtbuch.de/users/id/1
                    • gesichtbuch.de/users/stefan
                    • gesichtbuch.de/stefan


zondag 10 oktober 2010
zondag 10 oktober 2010
A simple API



zondag 10 oktober 2010
API

                    • Format specification
                    • Actions is the same
                    • Different output templates


zondag 10 oktober 2010
zondag 10 oktober 2010
Play more...



zondag 10 oktober 2010

Más contenido relacionado

Más de Stefan Koopmanschap

Git for Subversion Users (ZendCon 2011)
Git for Subversion Users (ZendCon 2011)Git for Subversion Users (ZendCon 2011)
Git for Subversion Users (ZendCon 2011)Stefan Koopmanschap
 
A Practical Look at Symfony2 (PHPNW11)
A Practical Look at Symfony2 (PHPNW11)A Practical Look at Symfony2 (PHPNW11)
A Practical Look at Symfony2 (PHPNW11)Stefan Koopmanschap
 
Open Up (International PHP Conference Spring Edition 2011)
Open Up (International PHP Conference Spring Edition 2011)Open Up (International PHP Conference Spring Edition 2011)
Open Up (International PHP Conference Spring Edition 2011)Stefan Koopmanschap
 
Would you like docs with that? - Zend Webinar
Would you like docs with that? - Zend WebinarWould you like docs with that? - Zend Webinar
Would you like docs with that? - Zend WebinarStefan Koopmanschap
 
Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)Stefan Koopmanschap
 
Integrating symfony and Zend Framework (IPC 2010)
Integrating symfony and Zend Framework (IPC 2010)Integrating symfony and Zend Framework (IPC 2010)
Integrating symfony and Zend Framework (IPC 2010)Stefan Koopmanschap
 
Would you like docs with that? (Pfcongres 2010)
Would you like docs with that? (Pfcongres 2010)Would you like docs with that? (Pfcongres 2010)
Would you like docs with that? (Pfcongres 2010)Stefan Koopmanschap
 
The Symfony Community - How to (get) help
The Symfony Community - How to (get) helpThe Symfony Community - How to (get) help
The Symfony Community - How to (get) helpStefan Koopmanschap
 
Integrating symfony and Zend Framework (PHPBarcelona 2009)
Integrating symfony and Zend Framework (PHPBarcelona 2009)Integrating symfony and Zend Framework (PHPBarcelona 2009)
Integrating symfony and Zend Framework (PHPBarcelona 2009)Stefan Koopmanschap
 
Integrating symfony and Zend Framework (PHPNW09)
Integrating symfony and Zend Framework (PHPNW09)Integrating symfony and Zend Framework (PHPNW09)
Integrating symfony and Zend Framework (PHPNW09)Stefan Koopmanschap
 
Integrating symfony and Zend Framework
Integrating symfony and Zend FrameworkIntegrating symfony and Zend Framework
Integrating symfony and Zend FrameworkStefan Koopmanschap
 
5 essential tools for the PHP Developer on Windows
5 essential tools for the PHP Developer on Windows5 essential tools for the PHP Developer on Windows
5 essential tools for the PHP Developer on WindowsStefan Koopmanschap
 
The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)Stefan Koopmanschap
 
Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)Stefan Koopmanschap
 
The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)Stefan Koopmanschap
 
The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)Stefan Koopmanschap
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony frameworkStefan Koopmanschap
 

Más de Stefan Koopmanschap (20)

A Practical Look At Symfony2
A Practical Look At Symfony2A Practical Look At Symfony2
A Practical Look At Symfony2
 
Git for Subversion Users (ZendCon 2011)
Git for Subversion Users (ZendCon 2011)Git for Subversion Users (ZendCon 2011)
Git for Subversion Users (ZendCon 2011)
 
A Practical Look at Symfony2 (PHPNW11)
A Practical Look at Symfony2 (PHPNW11)A Practical Look at Symfony2 (PHPNW11)
A Practical Look at Symfony2 (PHPNW11)
 
Conference Speaking 101
Conference Speaking 101Conference Speaking 101
Conference Speaking 101
 
Open Up (International PHP Conference Spring Edition 2011)
Open Up (International PHP Conference Spring Edition 2011)Open Up (International PHP Conference Spring Edition 2011)
Open Up (International PHP Conference Spring Edition 2011)
 
Would you like docs with that? - Zend Webinar
Would you like docs with that? - Zend WebinarWould you like docs with that? - Zend Webinar
Would you like docs with that? - Zend Webinar
 
Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)Would you like docs with that? (IPC 2010)
Would you like docs with that? (IPC 2010)
 
Integrating symfony and Zend Framework (IPC 2010)
Integrating symfony and Zend Framework (IPC 2010)Integrating symfony and Zend Framework (IPC 2010)
Integrating symfony and Zend Framework (IPC 2010)
 
Would you like docs with that? (Pfcongres 2010)
Would you like docs with that? (Pfcongres 2010)Would you like docs with that? (Pfcongres 2010)
Would you like docs with that? (Pfcongres 2010)
 
The Symfony Community - How to (get) help
The Symfony Community - How to (get) helpThe Symfony Community - How to (get) help
The Symfony Community - How to (get) help
 
Integrating symfony and Zend Framework (PHPBarcelona 2009)
Integrating symfony and Zend Framework (PHPBarcelona 2009)Integrating symfony and Zend Framework (PHPBarcelona 2009)
Integrating symfony and Zend Framework (PHPBarcelona 2009)
 
Integrating symfony and Zend Framework (PHPNW09)
Integrating symfony and Zend Framework (PHPNW09)Integrating symfony and Zend Framework (PHPNW09)
Integrating symfony and Zend Framework (PHPNW09)
 
Integrating symfony and Zend Framework
Integrating symfony and Zend FrameworkIntegrating symfony and Zend Framework
Integrating symfony and Zend Framework
 
Scrum (dutch)
Scrum (dutch)Scrum (dutch)
Scrum (dutch)
 
5 essential tools for the PHP Developer on Windows
5 essential tools for the PHP Developer on Windows5 essential tools for the PHP Developer on Windows
5 essential tools for the PHP Developer on Windows
 
The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)The Power Of Refactoring (php|tek 09)
The Power Of Refactoring (php|tek 09)
 
Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)Myphp-busters: symfony framework (php|tek 09)
Myphp-busters: symfony framework (php|tek 09)
 
The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)
 
The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)The Power Of Refactoring (4developers Krakow)
The Power Of Refactoring (4developers Krakow)
 
Myphp-busters: symfony framework
Myphp-busters: symfony frameworkMyphp-busters: symfony framework
Myphp-busters: symfony framework
 

symfony 1.4 workshop