1. DRUPAL 8 –
WHAT TO LEARN FROM SYMFONY?
Joonas Iivonen
Senior Developer
2. Symfony2 in D8
Drupal 8 will use Symfony components…
What does that mean?
Go and check D8’s core/vendor/symfony
and core/vendor/symfony-cmf
What of that do we need to learn in order to
start developing modules for Drupal 8?
3. OO, Namespaces,…
Ok, not really Symfony
Drupal 8 is much more Object-Oriented
and uses Namespace than before
Most of configuration is in YAML files
4. Routing
No more paths in hook_menu().
Routing matches Request to a Response
Imagesource:https://drupal.org/developing/api/8/routing
5. Routing
Routing file
modules/example/example.routing.yml
Or routing method returning an array of
SymfonyComponentRoutingRoute objects
or a
SymfonyComponentRoutingRouteCollection
object
Also possible to alter routes by extending
DrupalCoreRoutingRouteSubscriberBase
6. Services
Services are decoupled reusable
functionalities like database or emailer
Modules can define services in
modules/example/example.services.yml file
Services are provided to objects using
dependency injection
7. Twig
Ok, not really Symfony again
Twig is the new templating engine
Much nicer than the old PHP templates
8. PHPUnit
Yes. This is not Symfony either
Simpletest is still used for web tests and
DrupalUnitTests that need Drupal
Real unit testing uses PHPUnit
9. And there is more
Symfony
EventDispatcher
ClassLoader
Validator
Translation
Process
Serializer
Composer
Doctrine / Annotations
Guzzle, HTTP client
Assetic
EasyRDF
PSR-3 logging
Zend / Feed
+ all the new or changed Drupal concepts like
Plugins, Entity API, Fields, Forms…