Your SlideShare is downloading. ×
7Masters - ZendFramework2 & Symfony2
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

7Masters - ZendFramework2 & Symfony2

918

Published on

Apresentação de Wesley Victhor Mendes durante o 7Masters - Encontro iMasters de Especialistas em Zend Framework.

Apresentação de Wesley Victhor Mendes durante o 7Masters - Encontro iMasters de Especialistas em Zend Framework.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

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

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

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

×