July 2014

This week we dive deeper into working with events in Drupal 8. Last week we discussed what the role of events are and how they replace many parts of the hook system, but with the benefits of OOP. In this next set of videos we create a quick-and-dirty event using a generic class from Symfony and subscribe to it, then we create a more customized class that mirrors a structure that's a bit more like what you'll see in the real world.

Finally, we wrap it up by looking at overriding services. One of the bonuses of using services over our own class instances is that we can completely replace services with our own code, and we're ready to show you exactly how to do that.

How to create a custom event quickly with the GenericEvent class - 5:29

Typically creating new Symfony-based event requires the creation of a custom event class. In this video, however, we show you how you can create a quick and dirty event with the Symfony GenericEvent class. It’s handy!

How to subscribe to a custom event - 2:35

In this video we hook into the event we just created to demonstrate how any module can now create a subscriber to hook into it.

How to create a specialized custom event class - 5:04

While the GenericEvent class is handy for spinning up quick events, it’s also a bit … well … generic. In this video we use a custom event class to tighten up the signatures of our subscribers.

A final word on what we’ve learned about events - 0:46

In this video we do a quick celebration of the skills we’ve built around using events in Drupal 8.

(FREE!) How to override an existing service - 6:05

By this point you’re probably feeling pretty comfortable with services. We know how to use them and how to create them, but the one thing we haven’t tackled is overriding an existing service. Since this is one of the big arguments for using services in the first place, it makes sense to dive into replacing an existing service with our own.

Have a great week!

- Chris Shattuck

If you've done any coding at all in Drupal 7 or 6, you've used hooks to tap into the execution of code to change something - to alter a form, to add a JavaScript file, to add a new menu item. In Drupal 8 we still have many of the same hooks that we had in Drupal 7, but some use cases have been converted over to Symfony-based subscribers. Subscribers are similar to hooks, but they take an object-oriented approach which makes them testable and extendable. In the future, subscribers might replace hooks entirely. This week we dive deep into subscribers to give you a feel for when they might come in handy.

(FREE!) The differences and similarities between subscribers and hooks - 1:19

Subscribers in Symfony look an awful lot like hooks in Drupal, so what’s the difference? In this video we explain briefly how they work in tandem and what the future might be for hooks.

How to find an example subscriber class, and an overview of its structure - 3:39

Now that you’ve got a solid grasp of services, we can add another layer and register our own subscribers to Drupal or Symfony events. In this video we demonstrate how to dig up some examples and what the essential components of a subscriber class are.

How to find out what events we can subscribe to - 4:03

Knowing that we can subscribe to events is pretty awesome, but how to we figure out what events are out there? In this video we do a quick reconnoiter to figure out exactly that.

How to create a subscriber class - 3:37

After looking at how a subscriber class is structured, in this video we build our own.

How to register a subscriber as a service - 4:13

Just like any other service class, a subscriber class has to be registered as a service in order for it to run. In this video we look at how to register a subscriber and what makes it different than a normal service.

How to figure out what objects and methods we have to work with in a subscriber - 1:36

When an event triggers a method in our class, it usually passes an object that we can work with. Here we look at exactly how we figure out what’s in that object and what we can do with it. Fun!

(FREE!) How to get the route name for the current page and how “inheritdoc” works - 3:37

In Drupal 7, we had to use the dark arts to conjure up a match between the current path and the path we might be looking to match. In Drupal 8, with the introduction of routes, we can use a handy bit of code to grab the route and match against that, which is what we do in this video.

How to fix a "Class not found" error in Drupal 8 - 4:02

At some point during the transition over to object oriented programming, you’re going to hit upon a ‘class not found’ error. In this video we walk you through how to track down the source of the problem and get it fixed. Pow!

How to perform a redirect and how hook_init() has been replaced - 6:24

In Drupal 7, we could tap into the hook_init() function and perform a drupal_goto() if we wanted to redirect after executing a bit of logic. In Drupal 8, both hook_init() and drupal_goto() are no more. In this video we outline the techniques you’ll use to replace both.

Why you might choose to create events instead of hooks - 2:33

Hooks and events look an awful lot alike in Drupal 8, but there are some distinct benefits to using events instead.

Have a great week!

- Chris Shattuck

How to figure out what code to use to call a service - 3:46

By now you should feel like there’s no longer a huge mystery behind the dependency injection container in Drupal, but we still haven’t explored how exactly to use it. In this video we use a little detective work to figure out exactly how that’s done.

Setting up our example module scaffolding - 3:16

In this video we set up some basic scaffolding for the module we’ll use to demonstrate how Symfony components in Drupal 8.

Why hook_menu() was removed and why Drupal switched to PSR-4 autoloading - 2:50

Here we look at the two big changes that have been pushed to Drupal 8 since we first started recording “Drupal 8 Developer Prep”, and why those changes make sense.

(FREE!) How Drupal uses PSR-4 autoloading under the hood - 2:07

Just knowing that something works isn’t enough for the most curious, so in this video we build on our understanding of PSR-0 to understand how Drupal made the shift over to PSR-4.

Adding a page to our example module by using a route and controller - 5:47

In the very beginning of this series, we created a simple module whose job was to add a single page. In this video, we do the same thing so we have a page where we can safely add any output we need from our examples.

(FREE!) How to use services in a custom module - 3:15

We’ve seen how services are registered in Drupal, and we’ve seen how other modules use services, but how do we use them ourselves? Good question! That’s exactly what we’ll cover in this video.

How to find out which class is responsible for a service - 3:54

While there’s lot of really important benefits to using the dependency injection container, it comes at the cost of making it difficult to track down what code is responsible for which services. In this video we walk through two valuable approaches to tracking that code down.

How to create a service with a custom module - 4:15

At this point you’ve seen how to use existing services, but how do we create one of our own? Again, services allow other modules to override our entire service code and allows for the creation of a single, shared instance of the class, so there’s a lot to be gained. Luckily, it’s pretty easy and we’ll start by creating a class to contain our service.

How to call our custom service - 1:55

To test out our service, we give it a call in our controller just like we would call any other service.

(FREE!) An overview of why we should use services instead of simple functions or classes - 5:05

If you’re felling at all resentful or apprehensive about the added layers of complexity of the whole service system - as opposed to just creating simple functions, for example - this video does a quick review of the benefits of going the service route to help you get pumped about the long term benefits.

Have a great week!

- Chris Shattuck

This week we wrap up our coverage of YAML in detail, which prepares us fully to dive right into the Drupal 8 codebase and wrap our heads around the Dependency Injection Container. All of our prepwork in walking through each of the major Symfony components on their own is about to pay off now as we see how those components are used in Drupal 8. Enjoy!

Overview of YAML syntax, part 1 - Simple arrays and variable types - 6:20

In this video, we look at how to use YAML to store simple arrays and how YAML translates certain types of values into variable types. As you’ll see, YAML does a great job of guessing what we’re trying to accomplish.

Overview of YAML syntax, part 2 - Associative and nested arrays - 5:08

A YAML file is really just an array of arrays. In this video, we look at the different ways to structure associative arrays and what nested, nested arrays look like. You’ll be running into nested arrays all over in Drupal 8’s YAML files, so here we try to make them more approachable.

(FREE!) What "Separation of Concerns" means and how it applies to YAML and code - 5:42

If you’ve ever tried washing the dishes with a friend, you start by asking "who’s going to wash, and who’s going to dry?” If you both try doing both jobs at the same time, things can get kind of messy. You probably see the value of separating work into specialized areas all the time. When it comes to code, though, it can be hard to figure out where to draw the line. In this video, we try to explain why it can be valuable to spend the energy to figure out where that line is, and why drawing the line between code and configuration can make a lot of sense.

How to convert our dependency injector container into a services YAML file - 6:33

Now that’s you’ve gotten your feet wet (hopefully not due to a dish washing accident) with YAML, we look at one of the more complicated YAML structures you’re likely to see in Drupal 8 - the services YAML file, which feeds services into the dependency injection container.

How to load services into a dependency injector container with a YAML file - 3:43

After setting up our services YAML file, the next step is to get it wired into the dependency injection container. As part of this process, we also look at what to do when using two classes that have the same name.

How to make sure you're loading the right files in your project - 0:45

In this super short video, we explain a quick and dirty way to make sure that what you’re seeing in the browser is pulling from the right code files.

(FREE!) How the dependency injection container acts like a backbone to Drupal 8 - 1:15

Nearly every piece of code you touch in Drupal is in some way related to the dependency injection container. In this video, we explain the implications of that deep integration.

Taking at look at our our first Drupal 8 services.yml file - 2:35

Woo hoo! If you’ve been following along with these videos, you’ve gone on a long journey through Symfony with periodic promises that we will return to Drupal 8, and in this video we do exactly that. And we're going to start by looking at how Drupal 8 modules register services through the dependency injection container.

How to find the dependency injection container in Drupal 8, and an overview of how it is structured - 5:09

Now that we know how Drupal registers new services, we start to take a careful look at how exactly the dependency injection container works. In this video, we explore how to find the container and review its code structure.

How the dependency injection container accesses its services - 5:25

Knowing where to find the container is the first part of the puzzle, and in this video we build on that by looking under the hood at how exactly the container pulls up its services.

Have a great week!

- Chris Shattuck

For a long time, BuildAModule has supported supported 1 and 2 day trainings, but now some multi-month trainings have come out that allow a student to get a genuinely deep dive into Drupal before they jump into a job search. The idea behind these trainings is that it takes a while to start to feel comfortable with Drupal, and a live, ongoing environment that includes skilled mentorship can accelerate what students would normally do on their own and get them better prepared for the workforce. I think it's an awesome idea.

Here's a quick overview of two programs that are using an extended approach to help students speed up the learning process.

TechBootCamps

TechBootCamps is a really interesting and compelling concept. Students spend 8 weeks working full time (that's 8-hours days) on learning Drupal locally in Boston, MA, based on the BuildAModule curriculum. After 8 weeks, the students are connected up with agencies who are hiring, and if the student lands a job, the referral fee paid by the employer goes to cover at least part of the cost of tuition for the class.

The first batch of BootCamp-ers is currently a couple weeks into their training and it appears to be going really well. The program uses the Flipped Classroom model - similar to what we've been doing with Mentored Trainings - to allow students to work on practical skills instead of getting pummeled by lectures all day. To participate, students have to be on-location for the 8-week training, but they have set up discounted long-term lodging for students coming in from out of town. It really is a boot camp. :)

I'm proud of Joe DiDonato for putting together this program. It's incredibly innovative and I know it has the potential to do amazing things for the Drupal talent base. And I think keeping the training in a consistent physical location will have some surprising effects on the progress of the students.

The cost of the training starts at $4400, and again part or all of that will be reimbursed if the student lands a job and the employer pays a referral fee. The next camp starts in August (see the calendar here).

Learn more about TechBootCamps.

Drupal Career Online

Drupal Career Online is a real-time online version of the Drupal Career Starter program, which DrupalEasy has put on for the last several years. The program is a 12-week course that includes two 3.5 hour real-time online sessions every week and helps to connect students with internship programs when the course is complete. The curriculum is mature and bundles BuildAModule access as a complement to the existing course materials.

For potential students who can't necessarily make it to a specific physical location for a long-term training, but who can dedicate a significant amount of time to the learning process with the goal of landing a solid job, the Drupal Career Online program seems like a great fit. Many students from the live version of the course have gone on to find work with Drupal agencies.

The first class begins August 19th and you can apply here. The cost for the course is $3400.

Learn more about Drupal Career Online.

Thank you for your patience, 10 new videos now and lots more coming next week!

It's been a couple of weeks since we've released new videos, and I just wanted to say thanks for your patience. This week we're releasing 10 of the new batch, and next week we plan on releasing even more! I'm particularly excited about this second half of "Drupal 8 Developer Prep" since we get knee deep into working with Drupal 8 on a piratical level and look and build some real modules to demonstrate all kinds of fun concepts. Just so you know what awesomeness is coming down the pikes, here are some things you have to look forward to:

  • How to use Symfony components in Drupal 8, including the event dispatcher, routing and more!
  • How to use plugins (and what the heck plugins actually are)
  • How to work with forms in Drupal 8
  • How to use block plugins
  • How to use Twig for theming from inside a D8 module
  • How to upgrade a module from Drupal 7 to Drupal 8 and troubleshoot common issues along the way

I hope you enjoy this new infusion, and look forward to more in the coming weeks.

(FREE!) Overview of how we will prepare for the next Drupal 8 videos - 1:55

In this video we do a quick overview of how we’re about to set up for the next batch of Drupal 8 videos. Since the recording of the first videos in “Drupal 8 Developer Prep”, there have been new releases that bring in some fun changes like a better autoloader, a newer version of Symfony and more.

(FREE!) How to install Drupal 8 Alpha 12 with Dev Desktop 2 Beta - 4:19

Here we get a more up-to-date Drupal 8 environment set up and explain why we’re now using the latest version of Acquia Dev Desktop to launch our projects.

How to create a Drupal-based project in PHPStorm - 1:20

In all the the videos on BuildAModule up to this point, we’ve been using an IDE called Komodo. Here, we switch over to using PHPStorm and explain the process of importing a Drupal project.

The benefits of using PHPStorm for an IDE for Drupal work - 2:36

Many of our viewers adopted Komodo as an IDE because of the examples on BuildAModule, so in the next couple of videos we explore why shifted over to PHPStorm. As an IDE, it’s been gaining popularity in the Drupal community over the last several years and it’s worth exploring some of the reasons why.

The benefits of using PHPStorm for general development - 4:47

In the last video we discussed some of the big benefits of using PHPStorm with Drupal-based projects, and in this video we discuss some of the other features that developers might find useful in general, regardless of the kind of PHP project you’re working with.

How to get our example folder set up - 3:19

If you’re just jumping into this series, we walk you through the process of getting an example folder set up with all of the files that we’ve been building up through the previous videos. If you’ve been following along, there’s just a couple bits in here you’ll need to make sure you’ve got everything set up for the next videos.

Why we are going to do a deep dive into YAML - 0:59

On its surface, YAML is kind of just (Y)et (A)nother (M)arkup (L)anguage, giving us the ability to structure a hierarchy of information with a relatively simple syntax. But, the implications of using YAML goes deep, and in Drupal 8 you will be using YAML for everything from routes to services to configuration and menu links. Getting comfortable with YAML will serve you well during your Drupal 8 career, and in this video we explain why.

How to create a YAML file for routes - 6:21

To see YAML in action, we first look at how to create a routing YAML file in Symfony to replace the code-based routes we used in our previous examples.

(FREE!) How to parse a routing YAML file - 5:27

Now that we have a routing file, it’s time to figure out how to actually use it. In this video, we walk through the process of wiring up a YAML file to our route loader and get rid of a bunch of redundant code. Yea!

How to parse generic YAML files and setting up our YAML syntax examples - 3:56

In the next videos, we take a look at nearly all of the syntax you’re likely to encounter in YAML files. But first, we set up our example YAML file and take over an existing controller to see how Symfony converts YAML into a PHP array.

Have a great week!

- Chris Shattuck

Add to playlist

Add to , or

Add to new playlist:

Add to playlist
This is a member-only feature
But, it's easy to become a member

Add to cart:


Loading...
Contact us

Below are the supported keyboard shortcuts for our video player.

space
Start / stop video
shift
Go to next video
shift
Go to previous video
Increase or decrease player speed by 20%
Skip ahead or go back by 15 seconds
1...9
Jump to a percentage (2 is 20%, for example)
f
Toggle full screen
Videos Pricing More Search
BuildAModule Logo Icon BuildAModule Logo Icon
Become a member!
$29
1 month
$156
6 months
10% off
$276
12 months
20% off
All memberships come with the following:
24 / 7 access to the entire 1800+ video library
An innovative video player with a rolling transcript
Extensive Drupal and cross-platform training
A thorough and thoughtful training style
Progress tracking
Take notes on specific video sections
Intuitive multi-user management
How many users?
user
Go solo with a single user, or give multiple team members access through one account and get discounts by bundling multiple users into a single membership.