SlideShare una empresa de Scribd logo
1 de 18
Descargar para leer sin conexión
INTRODUZIONE PRATICA A SYMFONY
ALESSIO BARNINI
http://it.linkedin.com/in/
alessiobarnini
@barno7
alessio@ibuildings.it
https://github.com/IbuildingsItaly/
drupal-days-code-symfony-introduction
#DrupalDaysIT
• Un framework.
• Un insieme di strumenti.
• Una metodologia di sviluppo.
• Una filosofia.
• Una comunità.
CHE COSA E’ SYMFONY
#DrupalDaysIT
• + Bundle
• + documentato
• + supporto
• + sicurezza
• amico di Drupal ^_^
PERCHÈ SCEGLIERE SYMFONY
#DrupalDaysIT
• Client Server
• Client Server
• Il “lavoro sporco” è fatto dal front controller.
COME “FUNZIONA” ?
#DrupalDaysIT
Ogni richiesta esegue un file Front Controller
!
Il sistema delle rotte determina quale funzione PHP
deve essere eseguita
IL FLUSSO DI UN’APPLICAZIONE
#DrupalDaysIT
!
!
La giusta funzione PHP è eseguita, con il proprio
codice che crea e restituisce l'oggetto Response
appropriato.
IL FLUSSO DI UN’APPLICAZIONE
#DrupalDaysIT
DOCTRINE
• Symfony utilizza Doctrine
• E’ un ORM (Object-Relational Mapping).
• Potenti Strumenti di mappatura
#DrupalDaysIT
TWIG
• Symfony utilizza Twig
• Twig è un template engine
• Sviluppato da SensioLab
#DrupalDaysIT
• E’ un tool che permette una gestione efficace delle
dipendenze
• Gestisce l’autoloading e i namespace
• Permette quindi di installare facilmente i Vendor
COMPOSER
#DrupalDaysIT
COMPOSER
• Si installa con

!
• Viene creato un composer.json
•
• Grazie a composer possiamo installare facilmente
Symfony
curl -sS https://getcomposer.org/installer | php
composer install
#DrupalDaysIT
• I Vendor sono dipendenze di Symfony
• Quindi anche i bundle di terze parti
• Un bundle è una cartella con un insieme di file che
implementa una singola caratteristica
VENDOR
#DrupalDaysIT
INSTALLARE SYMFONY
curl -sS https://getcomposer.org/installer | php
• Installare Composer
!
• Installare Symfony
!
php composer.phar create-project symfony/framework-
standard-edition path/ 2.4.3
#DrupalDaysIT
INSTALLARE SYMFONY
#DrupalDaysIT
INSTALLARE SYMFONY
#DrupalDaysIT
INSTALLARE SYMFONY
a fine installazione collegandosi a localhost/
config.php è possibile verificare la corretta
installazione 

!
#DrupalDaysIT
GLI AMBIENTI
In Symfony ci sono 3 Ambienti. Dev - Prod e Test.

Ogni ambiente carica una propria configurazione. 

per l'ambiente dev: app/config/config_dev.yml
per l'ambiente prod: app/config/config_prod.yml
per l'ambiente test: app/config/config_test.yml
SPONSOR
MEDIA PARTNER

Más contenido relacionado

Destacado

Destacado (19)

Symfony ignite
Symfony igniteSymfony ignite
Symfony ignite
 
Symfony 2
Symfony 2Symfony 2
Symfony 2
 
Symfony 3
Symfony 3Symfony 3
Symfony 3
 
PHP, non lo stesso vecchio linguaggio
PHP, non lo stesso vecchio linguaggioPHP, non lo stesso vecchio linguaggio
PHP, non lo stesso vecchio linguaggio
 
The road to php7
The road to php7The road to php7
The road to php7
 
A Practical Introduction to Symfony2
A Practical Introduction to Symfony2A Practical Introduction to Symfony2
A Practical Introduction to Symfony2
 
PHP 7 et Symfony 3
PHP 7 et Symfony 3PHP 7 et Symfony 3
PHP 7 et Symfony 3
 
PHP 7 - benvenuto al futuro
PHP 7 - benvenuto al futuroPHP 7 - benvenuto al futuro
PHP 7 - benvenuto al futuro
 
From * to Symfony2
From * to Symfony2From * to Symfony2
From * to Symfony2
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
 
Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3
Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3
Tomáš Votruba - Hot news! PHP 7.0, 7.1 a Symfony 3.1, 3.2 a 3.3
 
Symfony2 Introduction Presentation
Symfony2 Introduction PresentationSymfony2 Introduction Presentation
Symfony2 Introduction Presentation
 
Doctrine for Dummies
Doctrine for DummiesDoctrine for Dummies
Doctrine for Dummies
 
Symfony2 and AngularJS
Symfony2 and AngularJSSymfony2 and AngularJS
Symfony2 and AngularJS
 
Introduzione al linguaggio PHP
Introduzione al linguaggio PHPIntroduzione al linguaggio PHP
Introduzione al linguaggio PHP
 
PHP 7
PHP 7PHP 7
PHP 7
 
Last train to php 7
Last train to php 7Last train to php 7
Last train to php 7
 
Symfony Best Practices
Symfony Best Practices Symfony Best Practices
Symfony Best Practices
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 

Similar a Introduzione pratica a Symfony

Introduzione alla localizzazione web
Introduzione alla localizzazione webIntroduzione alla localizzazione web
Introduzione alla localizzazione webQabiria
 
Drupal in the Cloud
Drupal in the CloudDrupal in the Cloud
Drupal in the CloudTwinbit
 
Francesco Trucchia: Rapid Application Developement con strumenti Open Source
Francesco Trucchia: Rapid Application Developement con strumenti Open SourceFrancesco Trucchia: Rapid Application Developement con strumenti Open Source
Francesco Trucchia: Rapid Application Developement con strumenti Open SourceFrancesco Fullone
 
Universal app ma universal per davvero
Universal app ma universal per davveroUniversal app ma universal per davvero
Universal app ma universal per davveroKlab
 
Drupal Day 2011 - Drupal per la ricerca, il caso EAI
Drupal Day 2011 - Drupal per la ricerca, il caso EAIDrupal Day 2011 - Drupal per la ricerca, il caso EAI
Drupal Day 2011 - Drupal per la ricerca, il caso EAIDrupalDay
 
Come sfruttare tutte le potenzialità di Symfony in Drupal 8
Come sfruttare tutte le potenzialità di Symfony in Drupal 8Come sfruttare tutte le potenzialità di Symfony in Drupal 8
Come sfruttare tutte le potenzialità di Symfony in Drupal 8Wellnet srl
 
Come sfruttare tutte le potenzialità di Symfony in Drupal 8
Come sfruttare tutte le potenzialità di Symfony in Drupal 8Come sfruttare tutte le potenzialità di Symfony in Drupal 8
Come sfruttare tutte le potenzialità di Symfony in Drupal 8Eugenio Minardi
 
Un CMS in 25min con Symfony CMF
Un CMS in 25min con Symfony CMFUn CMS in 25min con Symfony CMF
Un CMS in 25min con Symfony CMFManuel Baldassarri
 
Tanti "piccoli rilasci" con Symfony2
Tanti "piccoli rilasci" con Symfony2Tanti "piccoli rilasci" con Symfony2
Tanti "piccoli rilasci" con Symfony2Fabio Mora
 
Soluzioni integrate per il design e la comunicazione digital: Extensis
Soluzioni integrate per il design e la comunicazione digital: ExtensisSoluzioni integrate per il design e la comunicazione digital: Extensis
Soluzioni integrate per il design e la comunicazione digital: ExtensisPico Srl
 
Continous Delivery & HQ Code
Continous Delivery & HQ CodeContinous Delivery & HQ Code
Continous Delivery & HQ CodeDaniele Mondello
 
Italian deft 7 manual 90
Italian deft 7 manual 90Italian deft 7 manual 90
Italian deft 7 manual 90mstrom62
 
Keynote del phpday 2010
Keynote del phpday 2010Keynote del phpday 2010
Keynote del phpday 2010pietrobr
 
Mocking Objects Practices
Mocking Objects PracticesMocking Objects Practices
Mocking Objects PracticesGrUSP
 

Similar a Introduzione pratica a Symfony (20)

Presentazione framework Symfony
Presentazione framework Symfony Presentazione framework Symfony
Presentazione framework Symfony
 
Introduzione alla localizzazione web
Introduzione alla localizzazione webIntroduzione alla localizzazione web
Introduzione alla localizzazione web
 
Drupal in the Cloud
Drupal in the CloudDrupal in the Cloud
Drupal in the Cloud
 
Francesco Trucchia: Rapid Application Developement con strumenti Open Source
Francesco Trucchia: Rapid Application Developement con strumenti Open SourceFrancesco Trucchia: Rapid Application Developement con strumenti Open Source
Francesco Trucchia: Rapid Application Developement con strumenti Open Source
 
Universal app ma universal per davvero
Universal app ma universal per davveroUniversal app ma universal per davvero
Universal app ma universal per davvero
 
Drupal Day 2011 - Drupal per la ricerca, il caso EAI
Drupal Day 2011 - Drupal per la ricerca, il caso EAIDrupal Day 2011 - Drupal per la ricerca, il caso EAI
Drupal Day 2011 - Drupal per la ricerca, il caso EAI
 
Come sfruttare tutte le potenzialità di Symfony in Drupal 8
Come sfruttare tutte le potenzialità di Symfony in Drupal 8Come sfruttare tutte le potenzialità di Symfony in Drupal 8
Come sfruttare tutte le potenzialità di Symfony in Drupal 8
 
Come sfruttare tutte le potenzialità di Symfony in Drupal 8
Come sfruttare tutte le potenzialità di Symfony in Drupal 8Come sfruttare tutte le potenzialità di Symfony in Drupal 8
Come sfruttare tutte le potenzialità di Symfony in Drupal 8
 
Un CMS in 25min con Symfony CMF
Un CMS in 25min con Symfony CMFUn CMS in 25min con Symfony CMF
Un CMS in 25min con Symfony CMF
 
Silex, iniziamo
Silex, iniziamoSilex, iniziamo
Silex, iniziamo
 
Tanti "piccoli rilasci" con Symfony2
Tanti "piccoli rilasci" con Symfony2Tanti "piccoli rilasci" con Symfony2
Tanti "piccoli rilasci" con Symfony2
 
Soluzioni integrate per il design e la comunicazione digital: Extensis
Soluzioni integrate per il design e la comunicazione digital: ExtensisSoluzioni integrate per il design e la comunicazione digital: Extensis
Soluzioni integrate per il design e la comunicazione digital: Extensis
 
Presentazione wi400 i5
Presentazione wi400 i5Presentazione wi400 i5
Presentazione wi400 i5
 
Web frameworks
Web frameworksWeb frameworks
Web frameworks
 
Continous Delivery & HQ Code
Continous Delivery & HQ CodeContinous Delivery & HQ Code
Continous Delivery & HQ Code
 
Italian deft 7 manual 90
Italian deft 7 manual 90Italian deft 7 manual 90
Italian deft 7 manual 90
 
Keynote del phpday 2010
Keynote del phpday 2010Keynote del phpday 2010
Keynote del phpday 2010
 
WordCamp Catania 2019 PWA e TWA
WordCamp Catania 2019 PWA e TWAWordCamp Catania 2019 PWA e TWA
WordCamp Catania 2019 PWA e TWA
 
Web frameworks
Web frameworksWeb frameworks
Web frameworks
 
Mocking Objects Practices
Mocking Objects PracticesMocking Objects Practices
Mocking Objects Practices
 

Más de Eugenio Minardi

Delphi and ExtJS (26 ottobre 2017)
Delphi and ExtJS (26 ottobre 2017)Delphi and ExtJS (26 ottobre 2017)
Delphi and ExtJS (26 ottobre 2017)Eugenio Minardi
 
ExtJS: La piattaforma vincente (tools)
ExtJS: La piattaforma vincente (tools)ExtJS: La piattaforma vincente (tools)
ExtJS: La piattaforma vincente (tools)Eugenio Minardi
 
ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)Eugenio Minardi
 
ExtJS: La piattaforma vincente (rich UI)
ExtJS: La piattaforma vincente (rich UI)ExtJS: La piattaforma vincente (rich UI)
ExtJS: La piattaforma vincente (rich UI)Eugenio Minardi
 
ExtJS: La piattaforma vincente (class system)
ExtJS: La piattaforma vincente (class system)ExtJS: La piattaforma vincente (class system)
ExtJS: La piattaforma vincente (class system)Eugenio Minardi
 
ExtJS: La piattaforma vincente
ExtJS: La piattaforma vincenteExtJS: La piattaforma vincente
ExtJS: La piattaforma vincenteEugenio Minardi
 
Distributed Team Management: 
Pitfall, Challenges and Advantages
Distributed Team Management: 
Pitfall, Challenges and AdvantagesDistributed Team Management: 
Pitfall, Challenges and Advantages
Distributed Team Management: 
Pitfall, Challenges and AdvantagesEugenio Minardi
 
A Practical Introduction to Symfony (European Drupal Days 2015)
A Practical Introduction to Symfony (European Drupal Days 2015)A Practical Introduction to Symfony (European Drupal Days 2015)
A Practical Introduction to Symfony (European Drupal Days 2015)Eugenio Minardi
 
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)UN World Food Programme Standards & Best Practises (European Drupal Days 2015)
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)Eugenio Minardi
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Eugenio Minardi
 
Optimizing MariaDB for Web Applications (European Drupal Days 2015)
Optimizing MariaDB for Web Applications (European Drupal Days 2015)Optimizing MariaDB for Web Applications (European Drupal Days 2015)
Optimizing MariaDB for Web Applications (European Drupal Days 2015)Eugenio Minardi
 
PhpStorm for Drupal Development (European Drupal Days 2015)
PhpStorm for Drupal Development (European Drupal Days 2015)PhpStorm for Drupal Development (European Drupal Days 2015)
PhpStorm for Drupal Development (European Drupal Days 2015)Eugenio Minardi
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Eugenio Minardi
 
Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)
Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)
Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)Eugenio Minardi
 
The multilingual Drupal 8 experience (European Drupal Days 2015)
The multilingual Drupal 8 experience (European Drupal Days 2015)The multilingual Drupal 8 experience (European Drupal Days 2015)
The multilingual Drupal 8 experience (European Drupal Days 2015)Eugenio Minardi
 
Another Copernican Revolution: maintenance first, projects second (European D...
Another Copernican Revolution: maintenance first, projects second (European D...Another Copernican Revolution: maintenance first, projects second (European D...
Another Copernican Revolution: maintenance first, projects second (European D...Eugenio Minardi
 
Drupal Security: How to survive Drupalgeddon and prepare for future (European...
Drupal Security: How to survive Drupalgeddon and prepare for future (European...Drupal Security: How to survive Drupalgeddon and prepare for future (European...
Drupal Security: How to survive Drupalgeddon and prepare for future (European...Eugenio Minardi
 
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...Eugenio Minardi
 
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)Eugenio Minardi
 
Secure Drupal, from start to finish (European Drupal Days 2015)
Secure Drupal, from start to finish (European Drupal Days 2015)Secure Drupal, from start to finish (European Drupal Days 2015)
Secure Drupal, from start to finish (European Drupal Days 2015)Eugenio Minardi
 

Más de Eugenio Minardi (20)

Delphi and ExtJS (26 ottobre 2017)
Delphi and ExtJS (26 ottobre 2017)Delphi and ExtJS (26 ottobre 2017)
Delphi and ExtJS (26 ottobre 2017)
 
ExtJS: La piattaforma vincente (tools)
ExtJS: La piattaforma vincente (tools)ExtJS: La piattaforma vincente (tools)
ExtJS: La piattaforma vincente (tools)
 
ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)
 
ExtJS: La piattaforma vincente (rich UI)
ExtJS: La piattaforma vincente (rich UI)ExtJS: La piattaforma vincente (rich UI)
ExtJS: La piattaforma vincente (rich UI)
 
ExtJS: La piattaforma vincente (class system)
ExtJS: La piattaforma vincente (class system)ExtJS: La piattaforma vincente (class system)
ExtJS: La piattaforma vincente (class system)
 
ExtJS: La piattaforma vincente
ExtJS: La piattaforma vincenteExtJS: La piattaforma vincente
ExtJS: La piattaforma vincente
 
Distributed Team Management: 
Pitfall, Challenges and Advantages
Distributed Team Management: 
Pitfall, Challenges and AdvantagesDistributed Team Management: 
Pitfall, Challenges and Advantages
Distributed Team Management: 
Pitfall, Challenges and Advantages
 
A Practical Introduction to Symfony (European Drupal Days 2015)
A Practical Introduction to Symfony (European Drupal Days 2015)A Practical Introduction to Symfony (European Drupal Days 2015)
A Practical Introduction to Symfony (European Drupal Days 2015)
 
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)UN World Food Programme Standards & Best Practises (European Drupal Days 2015)
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)
 
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)Drupal theming - a practical approach (European Drupal Days 2015)
Drupal theming - a practical approach (European Drupal Days 2015)
 
Optimizing MariaDB for Web Applications (European Drupal Days 2015)
Optimizing MariaDB for Web Applications (European Drupal Days 2015)Optimizing MariaDB for Web Applications (European Drupal Days 2015)
Optimizing MariaDB for Web Applications (European Drupal Days 2015)
 
PhpStorm for Drupal Development (European Drupal Days 2015)
PhpStorm for Drupal Development (European Drupal Days 2015)PhpStorm for Drupal Development (European Drupal Days 2015)
PhpStorm for Drupal Development (European Drupal Days 2015)
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)
 
Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)
Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)
Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)
 
The multilingual Drupal 8 experience (European Drupal Days 2015)
The multilingual Drupal 8 experience (European Drupal Days 2015)The multilingual Drupal 8 experience (European Drupal Days 2015)
The multilingual Drupal 8 experience (European Drupal Days 2015)
 
Another Copernican Revolution: maintenance first, projects second (European D...
Another Copernican Revolution: maintenance first, projects second (European D...Another Copernican Revolution: maintenance first, projects second (European D...
Another Copernican Revolution: maintenance first, projects second (European D...
 
Drupal Security: How to survive Drupalgeddon and prepare for future (European...
Drupal Security: How to survive Drupalgeddon and prepare for future (European...Drupal Security: How to survive Drupalgeddon and prepare for future (European...
Drupal Security: How to survive Drupalgeddon and prepare for future (European...
 
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...
 
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)
 
Secure Drupal, from start to finish (European Drupal Days 2015)
Secure Drupal, from start to finish (European Drupal Days 2015)Secure Drupal, from start to finish (European Drupal Days 2015)
Secure Drupal, from start to finish (European Drupal Days 2015)
 

Introduzione pratica a Symfony