SlideShare ist ein Scribd-Unternehmen logo
1 von 9
Downloaden Sie, um offline zu lesen
Arquitetura
Sf camp 2007, Dispatcher adicionado ao Sf 1.1
- Events
- Bundles
Andi/Matthew 2006 - phly
- Events
- Modules > Plugins*
Console :)
Console :( - ARGH!
Principais componentes em sua arquitetura
HttpFoundation, HttpKernel, Routing, EventDispatcher,
DependencyInjection e ClassLoader
ZendDI, ZendEventManager, ZendStdlib,
ZendLoaderStandardAutoloader, ZendServiceManager
API – Request/Response
$request->query->get('foo');
$request->request->get('bar');
$request->getMethod();
$this->redirect($this->generateUrl("homepage"));
$this->params()->fromPost('foo');
$this->params()->fromQuery('foo');
$this->params()->fromRoute('foo');
$this->params()->fromHeader('foo');
$this->params()->fromFiles('foo');
$this->redirect()->toRoute('route', array('action' => 'name'),
array('param => 1'));
$this->redirect()->toUrl('http://google.com');
API – Route
blog:
pattern: /
Defaults: { _controller: Bundle:Blog:index }
blog_rss:
pattern: /rss
Defaults: { _controller: Bundle:Blog:rss }
blog_rss_sub:
pattern: /rss/sub
Defaults: { _controller: Bundle:Blog:rssSub }
# ----- comment
comments:
pattern: /comments/{id}
defaults: { _controller: Bundle:Blog:comments }
requirements:
id: d+
#host: sf 2.2
$route = Part::factory(array(
'route' => array(
'type' => 'literal',
'options' => array(
'route' => '/',
'defaults' => array(
'controller' =>
'ApplicationControllerIndexController',
'action' => 'index'
)
),
),
'route_plugins' => $routePlugins,
'may_terminate' => true,
'child_routes' => array(
'blog' => array(
'type' => 'literal',
'options' => array(
'route' => 'blog',
'defaults' => array(
'controller' =>
'ApplicationControllerBlogController',
'action' => 'index'
)
),
'may_terminate' => true,
'child_routes' => array(
'rss' => array(
'type' => 'literal',
'options' => array(
'route' => '/rss',
'defaults' => array(
'action' => 'rss'
)
),
'may_terminate' => true,
'child_routes' => array(
'subrss' => array(
'type' => 'literal',
'options' => array(
'route' => '/sub',
'defaults' => array(
'action' => 'subrss'
)
)
)
)
)
)
),
'forum' => array(
'type' => 'literal',
'options' => array(
'route' => 'forum',
'defaults' => array(
'controller' =>
'ApplicationControllerForumController',
'action' => 'index'
)
)
)
)
));
// Segment, Custom, Regex, Hostname
Module
<?php
namespace Album;
class Module
{
public function getAutoloaderConfig()
{
return array(
'ZendLoaderClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
'ZendLoaderStandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
}
Usando o que tem de melhor
API Simples
Bundles, Bundles, Bundles
Melhores componentes/desacoplados.
Config, Config, Config.
http://static.zend.com/topics/MVC-architecture-ZF2.pdf
http://framework.zend.com/learn/
https://speakerdeck.com/skoop/zend-framework-2-and-symfony2-the-perfect-team-zendcon
Obrigado!
@victhor_mendes
Github/wesleyvicthor

Weitere ähnliche Inhalte

Was ist angesagt?

Decoupling Objects With Standard Interfaces
Decoupling Objects With Standard InterfacesDecoupling Objects With Standard Interfaces
Decoupling Objects With Standard Interfaces
Thomas Weinert
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
Tatsuhiko Miyagawa
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
patter
 
Java script for_art_pr_class
Java script for_art_pr_classJava script for_art_pr_class
Java script for_art_pr_class
rockjairik050
 

Was ist angesagt? (20)

OWASP Top 10 at International PHP Conference 2014 in Berlin
OWASP Top 10 at International PHP Conference 2014 in BerlinOWASP Top 10 at International PHP Conference 2014 in Berlin
OWASP Top 10 at International PHP Conference 2014 in Berlin
 
Report: Avalanche 'very likely' to host outdoor game at Coors Field
Report: Avalanche 'very likely' to host outdoor game at Coors FieldReport: Avalanche 'very likely' to host outdoor game at Coors Field
Report: Avalanche 'very likely' to host outdoor game at Coors Field
 
Decoupling Objects With Standard Interfaces
Decoupling Objects With Standard InterfacesDecoupling Objects With Standard Interfaces
Decoupling Objects With Standard Interfaces
 
Reusable bootstrap resources zend con 2010
Reusable bootstrap resources   zend con 2010Reusable bootstrap resources   zend con 2010
Reusable bootstrap resources zend con 2010
 
Session3
Session3Session3
Session3
 
Session8
Session8Session8
Session8
 
Get into the FLOW with Extbase
Get into the FLOW with ExtbaseGet into the FLOW with Extbase
Get into the FLOW with Extbase
 
SQL Injection in PHP
SQL Injection in PHPSQL Injection in PHP
SQL Injection in PHP
 
20 modules i haven't yet talked about
20 modules i haven't yet talked about20 modules i haven't yet talked about
20 modules i haven't yet talked about
 
symfony on action - WebTech 207
symfony on action - WebTech 207symfony on action - WebTech 207
symfony on action - WebTech 207
 
London XQuery Meetup: Querying the World (Web Scraping)
London XQuery Meetup: Querying the World (Web Scraping)London XQuery Meetup: Querying the World (Web Scraping)
London XQuery Meetup: Querying the World (Web Scraping)
 
Java script for_art_pr_class
Java script for_art_pr_classJava script for_art_pr_class
Java script for_art_pr_class
 
OSGI workshop - Become A Certified Bundle Manager
OSGI workshop - Become A Certified Bundle ManagerOSGI workshop - Become A Certified Bundle Manager
OSGI workshop - Become A Certified Bundle Manager
 
Make WordPress realtime.
Make WordPress realtime.Make WordPress realtime.
Make WordPress realtime.
 
Electrify your code with PHP Generators
Electrify your code with PHP GeneratorsElectrify your code with PHP Generators
Electrify your code with PHP Generators
 
Symfony without the framework
Symfony without the frameworkSymfony without the framework
Symfony without the framework
 
Laravel admin20170819
Laravel admin20170819Laravel admin20170819
Laravel admin20170819
 
Perl调用微博API实现自动查询应答
Perl调用微博API实现自动查询应答Perl调用微博API实现自动查询应答
Perl调用微博API实现自动查询应答
 
So cal0365productivitygroup feb2019
So cal0365productivitygroup feb2019So cal0365productivitygroup feb2019
So cal0365productivitygroup feb2019
 
7. Lower upper in Laravel
7. Lower upper in Laravel7. Lower upper in Laravel
7. Lower upper in Laravel
 

Andere mochten auch

Andere mochten auch (13)

Tech for non techs
Tech for non techsTech for non techs
Tech for non techs
 
XP - eXtreme Programming - 2010
XP - eXtreme Programming - 2010XP - eXtreme Programming - 2010
XP - eXtreme Programming - 2010
 
4 ferramentas para acompanhar seu app em produção pelo slack
4 ferramentas para acompanhar seu app em produção pelo slack4 ferramentas para acompanhar seu app em produção pelo slack
4 ferramentas para acompanhar seu app em produção pelo slack
 
Concurrency in Ruby
Concurrency in RubyConcurrency in Ruby
Concurrency in Ruby
 
Apresentação sobre Rails - 2010
Apresentação sobre Rails - 2010Apresentação sobre Rails - 2010
Apresentação sobre Rails - 2010
 
Otimizando tempo de build: performance da suíte de testes
Otimizando tempo de build: performance da suíte de testesOtimizando tempo de build: performance da suíte de testes
Otimizando tempo de build: performance da suíte de testes
 
Go Lang migrating billions of documents
Go Lang  migrating billions of documentsGo Lang  migrating billions of documents
Go Lang migrating billions of documents
 
Life hacks for productivity
Life hacks for productivityLife hacks for productivity
Life hacks for productivity
 
Otimizando tempo de build: performance da suíte de testes
Otimizando tempo de build: performance da suíte de testesOtimizando tempo de build: performance da suíte de testes
Otimizando tempo de build: performance da suíte de testes
 
7Masters jQuery - Eventos em jQuery, com Felquis Gimenes
7Masters jQuery - Eventos em jQuery, com Felquis Gimenes7Masters jQuery - Eventos em jQuery, com Felquis Gimenes
7Masters jQuery - Eventos em jQuery, com Felquis Gimenes
 
Ensinando e aprendendo com desafios
Ensinando e aprendendo com desafiosEnsinando e aprendendo com desafios
Ensinando e aprendendo com desafios
 
Docker na vida real
Docker na vida realDocker na vida real
Docker na vida real
 
Docker: uma visão geral e exemplos de uso
Docker: uma visão geral e exemplos de usoDocker: uma visão geral e exemplos de uso
Docker: uma visão geral e exemplos de uso
 

Ähnlich wie ZendFramework2 & Symfony2

jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the new
Remy Sharp
 
Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2
Fabien Potencier
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHP
Hari K T
 
Do you want a SDK with that API? (Nordic APIS April 2014)
Do you want a SDK with that API? (Nordic APIS April 2014)Do you want a SDK with that API? (Nordic APIS April 2014)
Do you want a SDK with that API? (Nordic APIS April 2014)
Nordic APIs
 

Ähnlich wie ZendFramework2 & Symfony2 (20)

jQuery: out with the old, in with the new
jQuery: out with the old, in with the newjQuery: out with the old, in with the new
jQuery: out with the old, in with the new
 
Advanced symfony Techniques
Advanced symfony TechniquesAdvanced symfony Techniques
Advanced symfony Techniques
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
Getting up & running with zend framework
Getting up & running with zend frameworkGetting up & running with zend framework
Getting up & running with zend framework
 
Getting up and running with Zend Framework
Getting up and running with Zend FrameworkGetting up and running with Zend Framework
Getting up and running with Zend Framework
 
Durian: a PHP 5.5 microframework with generator-style middleware
Durian: a PHP 5.5 microframework with generator-style middlewareDurian: a PHP 5.5 microframework with generator-style middleware
Durian: a PHP 5.5 microframework with generator-style middleware
 
Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2Unit and Functional Testing with Symfony2
Unit and Functional Testing with Symfony2
 
Nashvile Symfony Routes Presentation
Nashvile Symfony Routes PresentationNashvile Symfony Routes Presentation
Nashvile Symfony Routes Presentation
 
Aura Project for PHP
Aura Project for PHPAura Project for PHP
Aura Project for PHP
 
Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12Symfony components in the wild, PHPNW12
Symfony components in the wild, PHPNW12
 
ZF2 for the ZF1 Developer
ZF2 for the ZF1 DeveloperZF2 for the ZF1 Developer
ZF2 for the ZF1 Developer
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
 
エラー時にログに出力する情報と画面に表示する情報を分ける #LaravelTokyo
エラー時にログに出力する情報と画面に表示する情報を分ける #LaravelTokyoエラー時にログに出力する情報と画面に表示する情報を分ける #LaravelTokyo
エラー時にログに出力する情報と画面に表示する情報を分ける #LaravelTokyo
 
Apostrophe
ApostropheApostrophe
Apostrophe
 
PHP 5.4
PHP 5.4PHP 5.4
PHP 5.4
 
Zend Framework
Zend FrameworkZend Framework
Zend Framework
 
22.sessions in laravel
22.sessions in laravel22.sessions in laravel
22.sessions in laravel
 
Moving a high traffic ZF1 Enterprise Application to SF2 - Lessons learned
Moving a high traffic ZF1 Enterprise Application to SF2 - Lessons learnedMoving a high traffic ZF1 Enterprise Application to SF2 - Lessons learned
Moving a high traffic ZF1 Enterprise Application to SF2 - Lessons learned
 
Do you want a SDK with that API? (Nordic APIS April 2014)
Do you want a SDK with that API? (Nordic APIS April 2014)Do you want a SDK with that API? (Nordic APIS April 2014)
Do you want a SDK with that API? (Nordic APIS April 2014)
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

ZendFramework2 & Symfony2