Drupal 8 Vocab Lesson
Upcoming SlideShare
Loading in...5
×
 

Drupal 8 Vocab Lesson

on

  • 1,849 views

When you're getting to know (and love?) Drupal 8, you might hear a lot of words that you pretend to understand. It's OK, just check in here for the down-low on those headscratchers. This lesson in ...

When you're getting to know (and love?) Drupal 8, you might hear a lot of words that you pretend to understand. It's OK, just check in here for the down-low on those headscratchers. This lesson in Drupal 8 vocabulary covers these fun phrases...
- YAML
- Composer
- PSR-0
- Dependency Injection
- Service Containers
- Routing

Statistics

Views

Total Views
1,849
Views on SlideShare
1,795
Embed Views
54

Actions

Likes
0
Downloads
31
Comments
0

2 Embeds 54

http://www.mediacurrent.com 46
http://mis-gryphon.mediacurrentstaging.info 8

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

Drupal 8 Vocab Lesson Drupal 8 Vocab Lesson Presentation Transcript

  • Drupal 8 vocab lesson Mediacurrent Team Knowledge Share Derek DeRaps 2013-07-30
  • Agenda ● ● ● ● ● ● YAML Composer PSR-0 Dependency Injection Service Containers Routing
  • define: “yammel”
  • YAML ● ● ● ● “Yet Another Markup Language” “YAML Ain't Markup Language” Used to define .info files and other configuration Hands-on: ○ Let’s create a .info file for our error_notifier module
  • define: Composer
  • Composer ● “Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.” ● In Drupal-speak: Does the work formerly handled by the Libraries module (and much more). ● Important links: ○ https://getcomposer.org/installer ○ http://packagist.org ● Hands-on: ○ Let’s add the Swiftmailer library to our project.
  • define: PSR-0
  • PSR-0 ● ● ● A standard for autoloading classes. No more includes() and requires() (for the most part). Classes’ namespaces correspond to their location on disk. ○ Your classes’ namespaces always start with Drupalyour_module ○ On disk, that looks like ○ docroot/modules/custom/your_module/lib/Drupal/your_module/Your Class.php ● Class names correspond to filename ○ class MyClass { … } resides in MyClass.php ● Hands-on ○ Let’s declare a namespace and use other classes in our demo.
  • define: Dependency Injection
  • Dependency Injection ● “Declaratively express dependencies in the class definition rather than instantiating them in the class itself.” ● E.g., pass a TransportInterface to the Mailer class; it doesn't need to know whether it’s using SMTP, Sendmail, etc. ● “The less your code knows, the more reusable it is.” ○ (Sometimes, being ignorant is a good thing.) ● DI aims to help make our code: ○ Clutter-free, Reusable, Testable ● Awesome DrupalCon session by Kat Bailey: ● https://portland2013.drupal.org/session/dependency-injection-drupal-8
  • define: Service Containers
  • Service Containers ● Service ○ any PHP object that performs some sort of "global" task ● Service Container (aka dependency injection container) ○ a PHP object that manages the instantiation of services (i.e. objects). ● Examples: ○ EventSubscriber (“listens” for events … “Observer” OO pattern) ● Hands-on: ○ Let’s create an EventSubscriber service to send mail on 404 errors. ○ This might replace logic in (D7) hook_page_delivery_callback_alter
  • define: Routing
  • Routing ● ● Think: hook_menu (which is still available FYI). Hands-on ○ Let’s declare a route and then implement its Controller.
  • Thank You! Questions