SlideShare a Scribd company logo
1 of 11
Symfony 2 – why ?
- Framework separated from our code
- Everything is a bundle
- Composer to rule them all
- Lots of useful bundles
- Documentation
- Flexibility
What is a bundle ?
● A bundle is simply a structured set of files within a
directory that implement a single feature.
● Each directory contains everything related to that
feature, including PHP files, templates,
stylesheets, JavaScripts, tests and anything else.
● There is always 'but'. Common parts place out of
bundle.
● App specific bundles are interdependent
Core bricks
● Symfony 2
● Doctrine 2
● TWIG
● Your code
Symfony 2 - requirements
● PHP 5.3.3+
● PHP 5.4.0 – for build in server
● Composer
● MySql
Symfony 2 - installation
● Manual – full
● Manual – base only
● Composer
composer create-project symfony/framework-standard-edition myproject/ ~2.5
● Check what is missing
php app/check.php
Symfony 2 – installation
● Document root
● Cache and logs directory
● Run developer server (PHP 5.4.0+)
php app/console server:run
● Visit config.php
Symfony 2 – directory structure
● App
● Bin
● Src
● Vendor
● Web
Symfony 2 - environments
● Develop
app_dev.php
● Production
Symfony 2 – The Bundle
● Create new bundle - interactive
php app/console generate:bundle
● Create new bundle – one command
●
Symfony 2 – The Routing
● Simple route
articlebundle_article_top5:
path: /articles/top5
defaults: { _controller: DvsArticleBundle:Default:top5 }
● Advanced route
articlebundle_article_list:
path: /articles/{page}
defaults: { _controller: DvsArticleBundle:Default:list, page:1 }
methods: [GET]
requirements:
page: d+
Symfony 2 – The Routing II
● Routes list
php app/console router:debug
● Receive params in controller as list
indexAction($category, $page) – order doesnt matter
● Receive params in controller as Request object
indexAction(Request $request)
$request->query->get('page')
$request->request->get('page')

More Related Content

What's hot

What's hot (20)

Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Introduction to .NET Core
Introduction to .NET CoreIntroduction to .NET Core
Introduction to .NET Core
 
Short introduction - .net core and .net standard 2.0
Short introduction - .net core and .net standard 2.0Short introduction - .net core and .net standard 2.0
Short introduction - .net core and .net standard 2.0
 
.Net standard 2.0
.Net standard 2.0.Net standard 2.0
.Net standard 2.0
 
A little nginx (1)
A little nginx (1)A little nginx (1)
A little nginx (1)
 
Symfony, Oxid, Composer
Symfony, Oxid, ComposerSymfony, Oxid, Composer
Symfony, Oxid, Composer
 
Migrating .NET Application to .NET Core
Migrating .NET Application to .NET CoreMigrating .NET Application to .NET Core
Migrating .NET Application to .NET Core
 
Cross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet coreCross platform dotnet development using dotnet core
Cross platform dotnet development using dotnet core
 
Microfrontends Monoreops & Trunkbased based
Microfrontends Monoreops & Trunkbased basedMicrofrontends Monoreops & Trunkbased based
Microfrontends Monoreops & Trunkbased based
 
Full session asp net mvc vs aspnet core
Full session asp net mvc vs aspnet coreFull session asp net mvc vs aspnet core
Full session asp net mvc vs aspnet core
 
Net core
Net coreNet core
Net core
 
Dot Net Core
Dot Net CoreDot Net Core
Dot Net Core
 
Whats new in .net core 3
Whats new in .net core 3Whats new in .net core 3
Whats new in .net core 3
 
Overview of the new .NET Core and .NET Platform Standard
Overview of the new .NET Core and .NET Platform StandardOverview of the new .NET Core and .NET Platform Standard
Overview of the new .NET Core and .NET Platform Standard
 
.NET Core in the Real World
.NET Core in the Real World.NET Core in the Real World
.NET Core in the Real World
 
Portable PHP
Portable PHPPortable PHP
Portable PHP
 
Modules and artifacts in NPM by Anton Cherednikov
Modules and artifacts in NPM by Anton CherednikovModules and artifacts in NPM by Anton Cherednikov
Modules and artifacts in NPM by Anton Cherednikov
 
.Net Core
.Net Core.Net Core
.Net Core
 
OSS at Microsoft
OSS at MicrosoftOSS at Microsoft
OSS at Microsoft
 
.NET Standard - Under the Hood
.NET Standard - Under the Hood.NET Standard - Under the Hood
.NET Standard - Under the Hood
 

Similar to #1 Backend Meetup - Symfony 2 - wstęp

Learning Symfony2 by practice
Learning Symfony2 by practiceLearning Symfony2 by practice
Learning Symfony2 by practice
Vytautas Beliunas
 
An introduction to Symfony 2 for symfony 1 developers
An introduction to Symfony 2 for symfony 1 developersAn introduction to Symfony 2 for symfony 1 developers
An introduction to Symfony 2 for symfony 1 developers
Giorgio Cefaro
 
Composing Project Dependencies
Composing Project DependenciesComposing Project Dependencies
Composing Project Dependencies
Derek Gallo
 

Similar to #1 Backend Meetup - Symfony 2 - wstęp (20)

Learning Symfony2 by practice
Learning Symfony2 by practiceLearning Symfony2 by practice
Learning Symfony2 by practice
 
Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...Symfony under control. Continuous Integration and Automated Deployments in Sy...
Symfony under control. Continuous Integration and Automated Deployments in Sy...
 
Symfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim RomanovskySymfony Under Control by Maxim Romanovsky
Symfony Under Control by Maxim Romanovsky
 
Modularity problems
Modularity  problemsModularity  problems
Modularity problems
 
Symfony2 components to the rescue of your PHP projects
Symfony2 components to the rescue of your PHP projectsSymfony2 components to the rescue of your PHP projects
Symfony2 components to the rescue of your PHP projects
 
An introduction to Symfony 2 for symfony 1 developers
An introduction to Symfony 2 for symfony 1 developersAn introduction to Symfony 2 for symfony 1 developers
An introduction to Symfony 2 for symfony 1 developers
 
Composer namespacing
Composer namespacingComposer namespacing
Composer namespacing
 
Decoupling Content Management with Create.js and PHPCR
Decoupling Content Management with Create.js and PHPCRDecoupling Content Management with Create.js and PHPCR
Decoupling Content Management with Create.js and PHPCR
 
Frameworks choice
Frameworks choiceFrameworks choice
Frameworks choice
 
Structure of Chamilo 1.10: a new awakening
Structure of Chamilo 1.10: a new awakeningStructure of Chamilo 1.10: a new awakening
Structure of Chamilo 1.10: a new awakening
 
CodeIgniter Lab
CodeIgniter LabCodeIgniter Lab
CodeIgniter Lab
 
Build and deploy scientific Python Applications
Build and deploy scientific Python Applications  Build and deploy scientific Python Applications
Build and deploy scientific Python Applications
 
AtoM feature development
AtoM feature developmentAtoM feature development
AtoM feature development
 
Fluo CICD OpenStack Summit
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack Summit
 
Tribal Nova Docker feedback
Tribal Nova Docker feedbackTribal Nova Docker feedback
Tribal Nova Docker feedback
 
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
O365Con19 - Sharing Code Efficiently in your Organisation - Elio StruyfO365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
 
Rfselenium2 redhat
Rfselenium2 redhatRfselenium2 redhat
Rfselenium2 redhat
 
Continuous Integration at Mollie
Continuous Integration at MollieContinuous Integration at Mollie
Continuous Integration at Mollie
 
ZF2: Writing Service Components
ZF2: Writing Service ComponentsZF2: Writing Service Components
ZF2: Writing Service Components
 
Composing Project Dependencies
Composing Project DependenciesComposing Project Dependencies
Composing Project Dependencies
 

Recently uploaded

1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 

Recently uploaded (20)

Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
Jaipur ❤CALL GIRL 0000000000❤CALL GIRLS IN Jaipur ESCORT SERVICE❤CALL GIRL IN...
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...Basic Electronics for diploma students as per technical education Kerala Syll...
Basic Electronics for diploma students as per technical education Kerala Syll...
 
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...Max. shear stress theory-Maximum Shear Stress Theory ​  Maximum Distortional ...
Max. shear stress theory-Maximum Shear Stress Theory ​ Maximum Distortional ...
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
457503602-5-Gas-Well-Testing-and-Analysis-pptx.pptx
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Computer Graphics Introduction To Curves
Computer Graphics Introduction To CurvesComputer Graphics Introduction To Curves
Computer Graphics Introduction To Curves
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 

#1 Backend Meetup - Symfony 2 - wstęp

  • 1. Symfony 2 – why ? - Framework separated from our code - Everything is a bundle - Composer to rule them all - Lots of useful bundles - Documentation - Flexibility
  • 2. What is a bundle ? ● A bundle is simply a structured set of files within a directory that implement a single feature. ● Each directory contains everything related to that feature, including PHP files, templates, stylesheets, JavaScripts, tests and anything else. ● There is always 'but'. Common parts place out of bundle. ● App specific bundles are interdependent
  • 3. Core bricks ● Symfony 2 ● Doctrine 2 ● TWIG ● Your code
  • 4. Symfony 2 - requirements ● PHP 5.3.3+ ● PHP 5.4.0 – for build in server ● Composer ● MySql
  • 5. Symfony 2 - installation ● Manual – full ● Manual – base only ● Composer composer create-project symfony/framework-standard-edition myproject/ ~2.5 ● Check what is missing php app/check.php
  • 6. Symfony 2 – installation ● Document root ● Cache and logs directory ● Run developer server (PHP 5.4.0+) php app/console server:run ● Visit config.php
  • 7. Symfony 2 – directory structure ● App ● Bin ● Src ● Vendor ● Web
  • 8. Symfony 2 - environments ● Develop app_dev.php ● Production
  • 9. Symfony 2 – The Bundle ● Create new bundle - interactive php app/console generate:bundle ● Create new bundle – one command ●
  • 10. Symfony 2 – The Routing ● Simple route articlebundle_article_top5: path: /articles/top5 defaults: { _controller: DvsArticleBundle:Default:top5 } ● Advanced route articlebundle_article_list: path: /articles/{page} defaults: { _controller: DvsArticleBundle:Default:list, page:1 } methods: [GET] requirements: page: d+
  • 11. Symfony 2 – The Routing II ● Routes list php app/console router:debug ● Receive params in controller as list indexAction($category, $page) – order doesnt matter ● Receive params in controller as Request object indexAction(Request $request) $request->query->get('page') $request->request->get('page')