Arquitetura
Sf camp 2007, Dispatcher adicionado ao Sf 1.1
- Events
- Bundles
Andi/Matthew 2006 - phly
- Events
- Modules >...
Principais componentes em sua arquitetura
HttpFoundation, HttpKernel, Routing, EventDispatcher,
DependencyInjection e Clas...
API – Request/Response
$request->query->get('foo');
$request->request->get('bar');
$request->getMethod();
$this->redirect(...
API – Route
blog:
pattern: /
Defaults: { _controller: Bundle:Blog:index }
blog_rss:
pattern: /rss
Defaults: { _controller:...
Module
<?php
namespace Album;
class Module
{
public function getAutoloaderConfig()
{
return array(
'ZendLoaderClassMapAuto...
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...
ZendFramework2 & Symfony2
ZendFramework2 & Symfony2
Upcoming SlideShare
Loading in...5
×

ZendFramework2 & Symfony2

663

Published on

Lightning talk about the differences and advantages between ZendFramework and Symfony.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
663
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
20
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

ZendFramework2 & Symfony2

  1. 1. Arquitetura Sf camp 2007, Dispatcher adicionado ao Sf 1.1 - Events - Bundles Andi/Matthew 2006 - phly - Events - Modules > Plugins* Console :) Console :( - ARGH!
  2. 2. Principais componentes em sua arquitetura HttpFoundation, HttpKernel, Routing, EventDispatcher, DependencyInjection e ClassLoader ZendDI, ZendEventManager, ZendStdlib, ZendLoaderStandardAutoloader, ZendServiceManager
  3. 3. 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');
  4. 4. 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
  5. 5. 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'; } }
  6. 6. Usando o que tem de melhor API Simples Bundles, Bundles, Bundles Melhores componentes/desacoplados. Config, Config, Config.
  7. 7. 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
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×