• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
ZendFramework2 & Symfony2
 

ZendFramework2 & Symfony2

on

  • 746 views

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

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

Statistics

Views

Total Views
746
Views on SlideShare
732
Embed Views
14

Actions

Likes
1
Downloads
19
Comments
0

1 Embed 14

https://twitter.com 14

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    ZendFramework2 & Symfony2 ZendFramework2 & Symfony2 Presentation Transcript

    • 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