SlideShare a Scribd company logo
1 of 14
Download to read offline
SYMFONY 4
ALESSANDRO MINOCCHERI
@minompi
ABSTRACT
• Roadmap

• Create a new symfony project

• Folder structure

• So, what actually is Symfony Flex

• Routing

• First page with twig

• Dependency Injection

• Autowiring

• Tips

- profiler

- bundles

- form

• Analyze a symfony project
ROADMAP
CREATE A NEW SYMFONY PROJECT
FOLDER STRUCTURE
SO, WHAT ACTUALLY IS
SYMFONY FLEX
•Symfony flex is composer plugin that overrides default behavior of the require,
update, and remove commands.

•Symfony 4 requires Flex by default (line "symfony/flex": "^1.0" in composer.json) 

•During package installation it looks for a "recipe" for a given <package_name>
inside https://github.com/symfony/recipes repository

•config/bundles.php

Recipes are simple
manifest files with
optional additional files,
which defines how this
particular package
should be installed
ROUTING
- composer require annotations

- Annotations, YAML, XML, PHP



- Wildcard



- Placeholder



- bin/console debug:router



- Advanced routing


TWIG
Pass values to twig

Print values
Including file

composer require
assets
DEPENDENCY INJECTION
- Dependency injection is a design pattern whose
purpose is to: improve the testability, simplify code



- Composition VS Inheritance

- Autowiring
TIPS
- Profiler

- Bundles

- doctrine

- monolog

- fosrest

- fosuser

- guzzle

- jms serializer

- nelmio

- ramsey - uuid

- aws

- elastic search

- Form

- Commands bin/console
WE ARE HIRING!

More Related Content

What's hot

New! getting domino current is easier than you think v5
New! getting domino current is easier than you think v5New! getting domino current is easier than you think v5
New! getting domino current is easier than you think v5Andy Porter
 
Dev traning 2016 symfony
Dev traning 2016   symfonyDev traning 2016   symfony
Dev traning 2016 symfonySacheen Dhanjie
 
Rev it up with php on windows
Rev it up with php on windowsRev it up with php on windows
Rev it up with php on windowsJosh Holmes
 
Scaling WordPress on Microsoft
Scaling WordPress on MicrosoftScaling WordPress on Microsoft
Scaling WordPress on MicrosoftJosh Holmes
 
HCL Sametime Meetings 11.5 Pre-Release - Step-by-Step
HCL Sametime Meetings 11.5 Pre-Release - Step-by-StepHCL Sametime Meetings 11.5 Pre-Release - Step-by-Step
HCL Sametime Meetings 11.5 Pre-Release - Step-by-StepAles Lichtenberg
 
Wordpress On Windows
Wordpress On WindowsWordpress On Windows
Wordpress On WindowsJosh Holmes
 
Upgrade HCL Sametime server 11.0 to 11.5
Upgrade HCL Sametime server 11.0 to 11.5Upgrade HCL Sametime server 11.0 to 11.5
Upgrade HCL Sametime server 11.0 to 11.5Ales Lichtenberg
 

What's hot (7)

New! getting domino current is easier than you think v5
New! getting domino current is easier than you think v5New! getting domino current is easier than you think v5
New! getting domino current is easier than you think v5
 
Dev traning 2016 symfony
Dev traning 2016   symfonyDev traning 2016   symfony
Dev traning 2016 symfony
 
Rev it up with php on windows
Rev it up with php on windowsRev it up with php on windows
Rev it up with php on windows
 
Scaling WordPress on Microsoft
Scaling WordPress on MicrosoftScaling WordPress on Microsoft
Scaling WordPress on Microsoft
 
HCL Sametime Meetings 11.5 Pre-Release - Step-by-Step
HCL Sametime Meetings 11.5 Pre-Release - Step-by-StepHCL Sametime Meetings 11.5 Pre-Release - Step-by-Step
HCL Sametime Meetings 11.5 Pre-Release - Step-by-Step
 
Wordpress On Windows
Wordpress On WindowsWordpress On Windows
Wordpress On Windows
 
Upgrade HCL Sametime server 11.0 to 11.5
Upgrade HCL Sametime server 11.0 to 11.5Upgrade HCL Sametime server 11.0 to 11.5
Upgrade HCL Sametime server 11.0 to 11.5
 

Similar to Symfony4

Brief introduction to Symfony Flex
Brief introduction to Symfony FlexBrief introduction to Symfony Flex
Brief introduction to Symfony FlexFedir Kryvytskyi
 
Composing Symfony Apps Using Symfony Flex
Composing Symfony Apps Using Symfony FlexComposing Symfony Apps Using Symfony Flex
Composing Symfony Apps Using Symfony FlexDenis - Florin Rendler
 
Symfony4 - Deep dive
Symfony4 - Deep diveSymfony4 - Deep dive
Symfony4 - Deep diveSalma Ghareeb
 
Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3Fabien Potencier
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fwdays
 
Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Antonio Peric-Mazar
 
Unit testing symfony plugins with php unit
Unit testing symfony plugins with php unitUnit testing symfony plugins with php unit
Unit testing symfony plugins with php unitChristian Schaefer
 
Sympal The Flexible Symfony Cms
Sympal The Flexible Symfony CmsSympal The Flexible Symfony Cms
Sympal The Flexible Symfony Cmsnarkoza
 
Symfony, Oxid, Composer
Symfony, Oxid, ComposerSymfony, Oxid, Composer
Symfony, Oxid, ComposerChrstn Lck
 
Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009Fabien Potencier
 
How composer saved PHP
How composer saved PHPHow composer saved PHP
How composer saved PHPRyan Kilfedder
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkRyan Weaver
 
Nashville Php Symfony Presentation
Nashville Php Symfony PresentationNashville Php Symfony Presentation
Nashville Php Symfony PresentationBrent Shaffer
 
Symfony 4: A new way to develop applications #phpsrb
 Symfony 4: A new way to develop applications #phpsrb Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrbAntonio Peric-Mazar
 
Symfony Live 09 Symfony 2
Symfony Live 09 Symfony 2Symfony Live 09 Symfony 2
Symfony Live 09 Symfony 2narkoza
 
Symfony Deployment with Capifony #symfony_ja
Symfony Deployment with Capifony #symfony_jaSymfony Deployment with Capifony #symfony_ja
Symfony Deployment with Capifony #symfony_jaTak Nishikori
 
Introduction to symfony2
Introduction to symfony2Introduction to symfony2
Introduction to symfony2Pablo Godel
 
Symfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSkySymfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSkyPablo Godel
 

Similar to Symfony4 (20)

Brief introduction to Symfony Flex
Brief introduction to Symfony FlexBrief introduction to Symfony Flex
Brief introduction to Symfony Flex
 
Composing Symfony Apps Using Symfony Flex
Composing Symfony Apps Using Symfony FlexComposing Symfony Apps Using Symfony Flex
Composing Symfony Apps Using Symfony Flex
 
Symfony4 - Deep dive
Symfony4 - Deep diveSymfony4 - Deep dive
Symfony4 - Deep dive
 
Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3Symfony Components 2.0 on PHP 5.3
Symfony Components 2.0 on PHP 5.3
 
Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"Fabien Potencier "Symfony 4 in action"
Fabien Potencier "Symfony 4 in action"
 
Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3Symfony 2.0 on PHP 5.3
Symfony 2.0 on PHP 5.3
 
Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19Symfony 4: A new way to develop applications #ipc19
Symfony 4: A new way to develop applications #ipc19
 
Unit testing symfony plugins with php unit
Unit testing symfony plugins with php unitUnit testing symfony plugins with php unit
Unit testing symfony plugins with php unit
 
Sympal The Flexible Symfony Cms
Sympal The Flexible Symfony CmsSympal The Flexible Symfony Cms
Sympal The Flexible Symfony Cms
 
Symfony, Oxid, Composer
Symfony, Oxid, ComposerSymfony, Oxid, Composer
Symfony, Oxid, Composer
 
Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009Symfony2 San Francisco Meetup 2009
Symfony2 San Francisco Meetup 2009
 
How composer saved PHP
How composer saved PHPHow composer saved PHP
How composer saved PHP
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
 
Nashville Php Symfony Presentation
Nashville Php Symfony PresentationNashville Php Symfony Presentation
Nashville Php Symfony Presentation
 
Symfony 4: A new way to develop applications #phpsrb
 Symfony 4: A new way to develop applications #phpsrb Symfony 4: A new way to develop applications #phpsrb
Symfony 4: A new way to develop applications #phpsrb
 
PHP Conference - Phalcon hands-on
PHP Conference - Phalcon hands-onPHP Conference - Phalcon hands-on
PHP Conference - Phalcon hands-on
 
Symfony Live 09 Symfony 2
Symfony Live 09 Symfony 2Symfony Live 09 Symfony 2
Symfony Live 09 Symfony 2
 
Symfony Deployment with Capifony #symfony_ja
Symfony Deployment with Capifony #symfony_jaSymfony Deployment with Capifony #symfony_ja
Symfony Deployment with Capifony #symfony_ja
 
Introduction to symfony2
Introduction to symfony2Introduction to symfony2
Introduction to symfony2
 
Symfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSkySymfony Live San Francisco 2017 - Symfony @ OpenSky
Symfony Live San Francisco 2017 - Symfony @ OpenSky
 

More from Alessandro Minoccheri (9)

ServerSentEventsV2.pdf
ServerSentEventsV2.pdfServerSentEventsV2.pdf
ServerSentEventsV2.pdf
 
ServerSentEvents.pdf
ServerSentEvents.pdfServerSentEvents.pdf
ServerSentEvents.pdf
 
Kotlin hexagonal-architecture
Kotlin hexagonal-architectureKotlin hexagonal-architecture
Kotlin hexagonal-architecture
 
Hexagonal architecture ita
Hexagonal architecture itaHexagonal architecture ita
Hexagonal architecture ita
 
Hexagonal architecture
Hexagonal architectureHexagonal architecture
Hexagonal architecture
 
Smart working
Smart workingSmart working
Smart working
 
Symfony aws
Symfony awsSymfony aws
Symfony aws
 
Composer
ComposerComposer
Composer
 
Doctrine
DoctrineDoctrine
Doctrine
 

Recently uploaded

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

Symfony4

  • 3.
  • 4. ABSTRACT • Roadmap • Create a new symfony project • Folder structure • So, what actually is Symfony Flex • Routing • First page with twig • Dependency Injection • Autowiring • Tips
 - profiler
 - bundles
 - form • Analyze a symfony project
  • 6. CREATE A NEW SYMFONY PROJECT
  • 8. SO, WHAT ACTUALLY IS SYMFONY FLEX •Symfony flex is composer plugin that overrides default behavior of the require, update, and remove commands.
 •Symfony 4 requires Flex by default (line "symfony/flex": "^1.0" in composer.json) 
 •During package installation it looks for a "recipe" for a given <package_name> inside https://github.com/symfony/recipes repository
 •config/bundles.php

  • 9. Recipes are simple manifest files with optional additional files, which defines how this particular package should be installed
  • 10. ROUTING - composer require annotations
 - Annotations, YAML, XML, PHP
 
 - Wildcard
 
 - Placeholder
 
 - bin/console debug:router
 
 - Advanced routing 

  • 11. TWIG Pass values to twig
 Print values Including file
 composer require assets
  • 12. DEPENDENCY INJECTION - Dependency injection is a design pattern whose purpose is to: improve the testability, simplify code 
 - Composition VS Inheritance
 - Autowiring
  • 13. TIPS - Profiler
 - Bundles - doctrine
 - monolog
 - fosrest
 - fosuser - guzzle
 - jms serializer
 - nelmio
 - ramsey - uuid
 - aws
 - elastic search
 - Form - Commands bin/console