0
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 configuratio...
define:

Composer
Composer
●

“Composer is a tool for dependency management in PHP. It allows you to
declare the dependent libraries your pr...
define:

PSR-0
PSR-0
●
●
●

A standard for autoloading classes.
No more includes() and requires() (for the most part).
Classes’ namespace...
define:

Dependency
Injection
Dependency Injection
●

“Declaratively express dependencies in the class definition rather than
instantiating them in the ...
define:

Service
Containers
Service Containers
●

Service

○ any PHP object that performs some sort of "global" task

●

Service Container (aka depend...
define:

Routing
Routing
●
●

Think: hook_menu (which is still available FYI).
Hands-on
○ Let’s declare a route and then implement its Cont...
Thank You!

Questions
Upcoming SlideShare
Loading in...5
×

Drupal 8 Vocab Lesson

2,036

Published on

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

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

  • Be the first to like this

No Downloads
Views
Total Views
2,036
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
33
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Drupal 8 Vocab Lesson"

  1. 1. Drupal 8 vocab lesson Mediacurrent Team Knowledge Share Derek DeRaps 2013-07-30
  2. 2. Agenda ● ● ● ● ● ● YAML Composer PSR-0 Dependency Injection Service Containers Routing
  3. 3. define: “yammel”
  4. 4. 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
  5. 5. define: Composer
  6. 6. 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.
  7. 7. define: PSR-0
  8. 8. 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.
  9. 9. define: Dependency Injection
  10. 10. 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
  11. 11. define: Service Containers
  12. 12. 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
  13. 13. define: Routing
  14. 14. Routing ● ● Think: hook_menu (which is still available FYI). Hands-on ○ Let’s declare a route and then implement its Controller.
  15. 15. Thank You! Questions
  1. Gostou de algum slide específico?

    Recortar slides é uma maneira fácil de colecionar informações para acessar mais tarde.

×