ZendFramework2 & Symfony2

  • 594 views
Uploaded on

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

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

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
594
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
19
Comments
0
Likes
2

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