Learn Drupal

May 29th, 2014

Map of BuildAModule Members

Orders come into BuildAModule daily from all over the world, but I wanted to get a sense of just how broad the our user base was. So, I put together a quick interactive map using AMCharts, pulling data directly form our orders database to see just how much of the world has been BuildAModuled. here's what that looks like, with countries having made a purchase in blue:

I created this map to visualize our membership, but I wonder if maybe this map has more to offer. While this just illustrates one company's order activity, it also might be generally representative of where Drupal is most popular and also which countries might have issues making purchases for US-based products. While the two causes might be unrelated, it seems likely that the process of learning Drupal would be hindered if one can't take advantage of books or video training distributed from the US.

So, if you are from any of the countries not highlighted above, let us know what we can do to help get training to your area. Is it an issue with the US dollar exchange rate? Does Drupal not have a solid foothold yet? Is English not widely spoken in your area? Is there generally poor internet access? We'd like to do what we can to help Drupal communities grow, so let us know what you need by responding to this email or filling out our contact form.

And just in case you're curious, here's a map of purchases made in the US, broken down by state (yeah, that's all of them):

You can take a look at these live maps in higher resolution and interactivity on our maps page.

Upcoming FREE day for DrupalCon Sprints!

We're offering BuildAModule for FREE to anyone around the world who wants to help with the DrupalCon sprints, or just wants to beef up your knowledge so you can help with the sprints next time. On June 5th, just go to https://buildamodule.com/free and claim a free 24-hour pass.

Meet me at DrupalCon Austin

In addition to organizing and mentoring at the BuildAModule training at DrupalCon Austin, I (Chris Shattuck) will be wandering around the hallways of the Austin Convention Center, hoping to meet you! Feel free to pull me aside to let me know what you really think about BuildAModule or just say hello. I'll likely be wearing an orange BuildAModule T-shirt and will look something like this:

 

A few squashed bugs on BuildAModule.com

A recent update to the Chrome browser caused the videos on BuildAModule to play erratically. If you ran into this problem, please accept my apologies. But we spent some time working on this and got it fixed! So, if you love Chrome and had to switch to a different browser, feel free to come on back. Along the way we fixed a couple other issues that may have been bugging you (so to speak):

  1. Transcript links now work. So, you can right-click on any part of a transcript, copy the link and visit it later to start playing the video back at exactly that position. This is great for personal bookmarks.
  2. The count above the transcript which should tell you where you are in the collection now shows the right number (sorry about that!).
  3. Images in video updates are now clickable. When we released the big update to our site recently, it broke the ability to view larger versions of the images in the video updates. No longer!

As always, if there's anything you'd like to see added or updated on BuildAModule, please just let us know.

Have a great week!

- Chris Shattuck

May 27th, 2014

This should now be fixed. If you're still having issues with video playback, please refer to our troubleshooting guide.

Recent updates to Chrome are resulting in video playback issues. Please accept our apologies, but in the meantime you should be able to use Firefox, Safari or the latest versions of Internet Explorer to use the site without any issues. We will make an announcement as soon as we've resolved the problem. Thank you for your patience!

May 27th, 2014

BuildAModule is FREE on May 30th for Drupal Global Training Days

Drupal companies and user groups around the world will be hosting free Drupal trainings around the globe on May 30th as part of the Drupal Global Training Days initiative. To support the trainings and also help anyone who can't attend a physical training, we're offering the full 1100+ video library on BuildAModule for FREE on that day.

If you're organizing a training, consider encouraging your students to sign up for a free 24-hour pass to BuildAModule to supplement your curriculum.

If you didn't plan a training, but you'd like to do something to help, think about organizing a Mentored Training for your Drupal user group. It takes very little planning and is a lot of fun.

If you can't attend a training, but want to learn some Drupal, then sign up for a free 24-hour pass on May 30th and work through as much material on BuildAModule as you can. It's not as good as hooking up with live trainers, but it's the next best thing!

A few new videos on using a Dependency Injection Container

This week we dive into using a Dependency Injection Container (DIC), which ultimately serves as a backbone to Drupal 8 and its APIs. First we talk about what a Dependency Injection Container is, and then demonstrate how to create one with Symfony 2.

The disadvantage of instantiating objects inside our framework and how a dependency injection container can help - 3:07

Now that we’ve moved some of our front controller code into our framework, our framework is now creating a number of objects, making it harder to test and less flexible. This is the perfect transition for talking about how a dependency injection container can help manage exactly this type of problem.

(FREE!) How to create and use a dependency injection container, and what a singleton pattern is - 5:29

In this video we create a dependency injection container that allows us to manage a single instance of each one of our classes and allows us to load them only when needed. Along the way we explore what a singleton pattern is.

How to prepare objects in the dependency injection container with parameters and methods - 3:26

Objects in our dependency container sometimes have dependencies of their own. In this video we outline how you pass those dependencies into the container.

Last chance to get 25% off!

There's just a couple more days left to get 25% off your 6 or 12 month membership at BuildAModule. Just checkout with the code DCAUSTIN to get the discount.

May 16th, 2014

Nearly every developer uses this technique to find the code responsible for some output that they want to modify. It's simple:

  1. Find a string in the UI that seems like it would be unlikely to occur elsewhere in the UI. Something like "Settings for the Image Toolkit".
  2. Search the entire project code base for the string using grep or an IDE. If you get few enough matches, you can probably figure out what code is responsible for the output.
  3. Adjust the string slightly and rebuild the UI to see if the change takes effect. If it does, BAM! You know where to get started. (note that you may need to rebuild your application or clear the application's caches to see the change take effect).
  4. You revert the change you just made so you don't forget about it.

Where to find a unique string

Finding a unique string becomes easier the more familiar you are with the application you're working with. At first, you may find yourself searching for strings and getting hundreds or thousands of results. Over time you'll get a sense of the usual suspects and try to find other strings that aren't as common.

While the text in the UI can provide a good source, the "id" and "class" properties of HTML is also a good place to look if you're building a browser-based app. Sometimes these are automatically generated, or the string is added to with prefixes or suffixes, but you can search parts of these properties to see if anything shows up.

If a search doesn't turn anything up

If you search the code base for the string and nothing comes up, here are some tips:

  1. Source is in a database: The string could be being pulled from a database, rather than code. If so, then you can do a database dump and search the database dump file. It will probably be harder to track down exactly how that string came to end up where it is, but it's still a useful clue.
  2. String has quotes: If there are any quotes in the string, then they may be escaped with a backslash, meaning that you're not searching for exactly the right string. To get around this, you can search for one side or the other of the string. For the string "you're in my searches!', you could search for "re in my searches".
  3. String has hidden whitespace: There my be some extra white space that you're not aware of. If you're searching HTML, you can look at the source code to see if there are extra spaces between words, or even extra lines. If you can just grab a single line to search for, you can avoid trying to add the white space to your search (adding white space to search is tricky). Again, you can use the approach of just searching for part of the string.
  4. Searching the wrong case: CSS or your backend code may be adjusting the case of the string, adding capitals or lowercase where it isn't in the source code. So, try searching with the "match case" box unchecked.
  5. String has been altered: The text could be being modified through various process. In particular, unique IDs may be prefixed or suffixed, so try searching for bits between underscores or dashes.

What to do once you've found the source

Typically, finding the source of the string you're looking for is the beginning of your search. The goal is to find the right place to adjust or add to what you see in the UI, and there might be several layers between this entry point and where you'll ultimately add your own code.

  1. Use a debugger: Using a debugger like Xdebug is really useful here, so you can see the full stack of method or function calls leading up this specific point in the code.
  2. Copy and paste: If you're dealing with something modular like a CMS where chunks of code and groups of files follow the same pattern for extending the application, you can probably start copying and pasting entire files or parts of code from various sources and replacing unique identifiers in function and variable names until you get something that can work in parallel with the original code you discovered.

Is there some other name for this approach?

If you know of a name for this technique (one that I didn't make up), please let me know so I can delete this page.

May 12th, 2014

Last week we finished up talking about event dispatching in Symfony - a fun way to add easy-to-use hooks in your code - and this week we're tightening up the framework we've been building by adding error reporting and a controller that can return content directly without a response object wrapper. Next, we'll be talking about how a dependency injection container (DIC) can form an important backbone of objects in your project, so stay tuned!

(FREE!) The difference between setter injection and constructor injection - 1:00

When we instantiate our framework now, we use two different types of dependency injection. We pass two objects in through the constructor, and another through a method in our framework class. We talk briefly about why you would inject dependencies one way or the other here.

How to add custom error reporting to our framework - 3:28

In our earlier framework code, we wrapped the execution of our framework in a try … catch block to figure out how and when to display an error on the page. Our new Framework class gives us the same tool, and in this video we look at how to leverage it.

How to create a subscriber that allows controllers to return strings instead of response objects - 5:45

In order to get more control over our response object, we update our controllers to send strings instead of full response objects. To accomplish this feat, we have to adjust a few places in our code.

Reducing our front controller code by moving it to our Framework class - 3:17

Having a small front controller means that it’s easier to use multiple front controllers in different environments. Now that we have a clean Framework class, let’s explore putting some of our front controller code into it and see if we can’t tighten up our front controller a bit.

Only 3 weeks left to sign up!

That's right, the clock is ticking. If you're coming to Austin and want to get immersed in Drupal in a fun and ultra productive way, come join us at our training.

Read more about the training, or SIGN UP NOW!

May 6th, 2014

This week we're wrapping up our coverage of the Symfony Event Dispatcher - the component that mirrors (and could someday replace) the Drupal hook system. We then look into Symfony's built-in caching and finally trash a huge chunk of our code to instead use Symfony's HTTP Kernel component. It's always fun getting rid of code, especially when you can do the same thing with fewer lines. :)

(FREE!) How a subscriber is different than a listener, and what a 'code smell’ is - 2:09

When you have multiple listeners that will always be bundled together, or that will take the same parameters no matter which application will use them, it makes sense to refactor to us a ‘subscriber’ instead. As we discuss this, we also explain what a ‘code smell’ is.

How to add a subscriber to our event dispatcher - 3:41

Now that we know why we would want to have a subscriber instead of a listener, we go ahead and build one out.

Overview of what we covered around the event dispatcher - 1:47

In this overview, we review the difference between a listener and a subscriber, and briefly outline the steps we went through to set up our event dispatcher. Fun!

How to add caching support to our framework and controllers - 6:29

If you’ve worked with Drupal a bit, you probably understand how caching pages in certain situations can really save on processing power. In this video we explore how to add caching to our Symfony application.

How to use the Http Kernel component to replace our entire framework - 4:34

In this video, we replace all of the custom code in our Framework class with a single class definition using the Http Kernel component. Here it becomes clear that much of what we’ve been doing so far is building up to the point of understanding how the Http Kernel component can be useful.

April 28th, 2014

That's right, at DrupalCon Austin we're going to make you sweat! Bring whatever issues you're working on, a list of what you want to learn, or just show up with an open mind, and we'll get you moving in the right direction. That direction being up up, move that body, down down, sweep the ground! (but in a completely metaphorical sense) The first "Ah-ha!" moment you have, you'll be awarded with the fabled, rarely seen BuildAModule sweatband - the Crown of Absorption, a rare and stretchy breed of Noggin Adornment that you currently can't get any other way.

If the sweatband doesn't grab you, maybe the 12+ trainers we'll have at your disposal will. Or maybe the 4 months of FREE BuildAModule membership you get. Maybe it's just having a chance to gaze at my visage for a full, uninterrupted 8 hours? Whatever your breed of motivation, we'd love to see you there.

Read more about the training, or SIGN UP NOW!

5 More New Videos on Event Dispatching in Symfony

Last week we started our dive into event dispatching - something that looks a lot like hooks in Drupal. This week we add some listeners to our dispatcher and refactor it to use OOP where possible. In Drupal 8, the Symfony event dispatcher replaces certain hooks like hook_init(), and Drupal 9 might see a shift where we replace all hooks with the Symfony event dispatcher. This means that wrapping your mind around this particular component will come in handy pretty quick now and could pay off big time down the road.

(FREE!) How to add a listener with our event dispatcher - 4:26

All right, now that we have en event, let’s listen for it! In this video we set up a listener to get triggered when our event takes place.

A recap of how we set up our event dispatcher and listener - 2:49

In this video we do a review of the steps that went into creating our event and listener with the event dispatcher component.

Adding a second listener and setting its priority - 2:51

Here we take a look at some additional options we can pass to a listener and create a second listener.

How to create a class for an event listener - 4:06

In the spirit of object orientation, our listeners should really be their own classes. Here we take our listeners and wrap some classes around them, which sets us up perfectly for the next step.

Reviewing the code in our event listener classes - 2:03

In this video we take a look at the code in our newly added event listener classes. Nothing too complicated, but we want to get a feel for the structure of the classes before moving on.

April 28th, 2014

If you're considering taking the Acquia certification exam, it's probably a good idea to beef up on a few topics, even if you're a veteran. The certification program is still new, so it has yet to be seen just how valuable a meter it is for potential employers to gauge prospective employees, but the feedback so far has been generally positive. People who have taken the exam feel like the questions are thoughtful and that they reflect scenarios that a real-world Drupalist will have to deal with at some point or another. They're also tough. Like, sweating bullets tough. So, before plunking down the $250 to take the exam, it could do you good to review some material either as a refresher or to introduce you to the major topics that are outlined in the exam blueprint.

Because BuildAModule has been focused on dispensing practical Drupal learning for the last four years, we have a set of videos that map almost perfectly to the requirements of the Acquia certification. In addition to covering the broad topics, we also cover the in-between steps and concepts. From what we heard, questions on those in-between subjects are likely to emerge on the exam, so it could be a perfect fit, especially if you want to do some quick review.

Below is a mapping of BuildAModule videos to the Blueprint for the certification exam. Each heading is one of the domains or sub-topics that are evaluated. The paragraph below each sub-topic is a description of what BuildAModule videos are relevant to the topic. At this point, nearly all links point directly to BuildAModule. There are two other guides to other resources online, including Tanay's that references mostly Drupal.org resources, and Webchick's study guide.

Good luck!

Domain 1.0: Fundamental Web Development Concepts

1.1. Demonstrate knowledge of HTML and CSS

The video collections on BuildAModule assume a basic understanding of HTML and CSS, though we do go into how to rapidly test and adjust CSS using Firebug (the same skills apply to Chrome's developer tools). We also cover some common use cases for CSS such as hiding elements on the page and changing a background image.

One of the most common sites I've used sharpen HTML and CSS skills is at w3schools.com, though many people recommend Treehouse as well.

1.2. Identify PHP programing concepts

If you're new to PHP or to coding in general, the PHP Programming Basics will expose you to the most important techniques in procedural PHP programming with an angle towards eventually working in Drupal modules and themes. The exam doesn't appear to be focused on Drupal 8 yet, but you can also spend some time with our Object Oriented Programming (OOP) as well.

1.3. Identify JavaScript and jQuery programing concepts

We have an extensive chapter in the Drupal 7 Development Core Concepts collection on working with JavaScript and jQuery. In it, we look at how to add JavaScript inline or in external files, how to load JavaScript dynamically, how to use jQuery selectors and events, plus a lot more to fill in important gaps when working with JavaScript within Drupal.

1.4. Demonstrate the use of Git for version control

We created an entire series around using Git called Change Management and Version Control. In it, we first go through the process of installing Git and explain the major concepts behind version control in general. We then dive into the various Git commands and how to use them in a practical Drupal project. We also go over common branching strategies, like GitFlow, how to version control configuration from the database and a lot more.

Domain 2.0: Site Building

2.1 Demonstrate ability to create and configure Content Types with appropriate fields and field settings for building basic data structures

In the Build Your First Drupal 7 Web Site we go through the process of building a complete, practical Drupal 7 web site. Near the beginning, we explore how fields work and how to add new fields. We cover several of the default field types like taxonomy reference and node reference, as well as the Date field and Fivestar fields from contrib.

2.2. Demonstrate ability to configure field display and view modes for content types

We look at the field display settings in the process of hiding a field title (a common task). We also cover what view modes accomplish, how to choose the correct view mode for the right context and how to use the Display Suite module to modify and add new view modes.

2.3 Demonstrate ability to create and use Taxonomy vocabularies and terms for classification and organization of content

We start with a brief explanation of taxonomy and continue to explore how to add new vocabularies and terms.

2.4 Demonstrate ability to configure Blocks for building layouts from information widgets

After we discuss the role of blocks and what they are, we cover how to identify blocks as well as how to enable and configure blocks. We go through the processing of adding a new block and configuring its visibility settings. In a separate video collection called ]Advanced Site Building in Drupal 7](https://buildamodule.com/collection/advanced-site-building-in-drupal-7) we cover multiple methods for arranging blocks, including exploring the Context and Panels modules.

2.5 Demonstrate ability to build main and alternative navigation systems by using Menus

We have an extensive section on working with menus, including how to work with with the menu listing page, how to add and position new menu items. We explore working with secondary menus and adding menus as blocks. The videos around these sections also work through the nuances of working with the menu system.

2.6 Demonstrate ability to create and configure Views for building content list pages, blocks and feeds

After we dive into what the Views module is for and explore the basic components of a view, we go deep into several examples for using views to create a calendar-style list of events and also build a block to display a single piece of related content. We also explore using contextual filters and relationships (some of the more advanced and complicated features of Views). One thing we don't cover yet is how to create an RSS feed with Views.

Domain 3.0: Front end development (theming)

3.1 Given a scenario, demonstrate ability to create a custom theme or sub theme

Our Drupal 7 Theming Essentials walks you through the process of creating a theme from scratch as well as creating a sub-theme.

3.2 Demonstrate knowledge of theming concepts

In the first chapter of the Theming collection, called Important Drupal Theming Concepts, we discuss what theming is, review the numerous ways there are to modify the output of Drupal and how to choose the best method for each scenario. We explore the conventions behind view modes, field formatters and template files.

3.3 Demonstrate ability to build or override PHP templates for defining layout content

As we explore the various options for modifying the output of Drupal, we cover how to properly name and structure a template file and override existing templates.

3.4 Demonstrate ability to use theme () functions for overriding custom output

In addition to covering how to work with template files, we also demonstrate the process of creating a theme function and overriding existing theme functions.

3.5 Demonstrate ability to write template pre-process functions for overriding custom output

We cover the basics of creating a preprocessing function on the modular level or in a theme, and how to name them to work with templates or theme functions. We also explore ]how to get preprocessing functions to trigger only if certain conditions are met.

Domain 4.0: Back end development (coding)

4.1 Demonstrate ability to develop Custom Modules using Drupal API for extending Drupal functionality

In our Drupal 7 Development Core Concepts collection, we walk through the process of creating several practical modules. To begin with, we create a basic module to get a sense of the structure of the module folder. We walk through many common utility functions like l() and url() and dive deep into several APIs, including the Form API, the menu system, the Database API, the Node API and the user system. We also explore working with the theme layer and adding JavaScript and CSS files.

4.2 Demonstrate ability to work with Drupal's Database Abstraction Layer for managing tables and CRUD operations on data

We walk through the process of creating a module that manages the entire CRUD setup. We begin by explaining what the Database Abstraction Layer does, and then build the schema for our module using the Schema module. After that we work through the process of INSERT-ing, DELETE-ing and SELECT-ing from the database using the Database API. We also explore the benefits of writing a dynamic SELECT query and using hook_udpate_N() to keep module databases up to date.

4.3 Demonstrate ability to debug code and troubleshoot site problems

Throughout each of our video series, we talk through the process of troubleshooting problems with the site. The best way to get a feel for the various approaches you can take in narrowing down problems is to watch the videos in order and see how we approach problems when they arise. Throughout the development collections, we use Xdebug in order to inspect variables and stop code mid-way through execution. However, we also explore other approaches to tracking down specific problems. Doing a search on BuildAModule for "troubleshoot" will bring up some interesting videos, as well as a search for "error".

4.4 Demonstrate ability to write code using Drupal Coding Standards

Reviewing the Overview of Coding Standards section will bring you up to speed on how to make sure your code is good to go. In it, we talk through how to deal with white space, operators, comments and arrays, among other things.

4.5 Demonstrate ability to analyze and resolve site performance issues arising from site configuration and custom code

Improving performance is one area we haven't covered much on BuildAModule. We do discuss the importance of using include files to improve performance, but do not walk through the steps of identifying non-performant code.

4.6 Demonstrate ability to analyze and resolve security issues arising from site configuration and custom code

When it comes to writing secure code, we cover the most common mistakes and solutions. We dive into using string filtering functions, setting proper access control and working with the database securely. When it comes to configuration security, the most common problems that come into play are assigning the wrong permissions to your users. We go deep into how permissions and roles work, and what control each permission in Drupal core gives a user. We also explore some best practices in setting up roles.

April 21st, 2014

Last week to get $75 off DrupalCon training

This is the last week to get $75 off of our super amazing DrupalCon Austin training. Our style of training guarantees that you'll emerge with valuable knowledge that you can put to practical use, regardless of your skill level. Students throughout the years have commented on how much they value the one-on-one interaction that they get with trainers, and how nice it is to have a training that lets you work at your own pace and allows you to focus on knowledge that is the most important to you.

Signing up for the training also wins you 4 months of free BuildAModule access, so if you're planning on being a BuildAModule member for the next 4 months and are coming to DrupalCon, it's a perfect fit. With the $75 off this week and the $119 worth of BuildAModule access, you'll be getting 40% off.

BuildAModule trainings are also a really good way to kick of networking at DrupalCon. One of the biggest things you'll take away from coming to DrupalCon are the connections to the people you meet. Because of our unique training format, you'll have the opportunity to meet lots of people - both trainers and fellow students - that could play a critical role in your learning or your businesses down the road.

And of course, it would be awesome to meet you in person and have the honor of helping you make a big leap up the Drupal learning curve. :-)

Read more about the training, or sign up now!

 

5 New Videos on Event Dispatching

This week we wrap up our brief whirlwind through PHPUnit and start looking at the Event Dispatcher component of Symfony. For Drupal Veterans, you'll recognize that it's similar to the hook system in Drupal, but with the benefits of Object Orientation.

Looking at how our test and assertion actually work, and where to find out which assertions we can use - 2:28

After spending a bit of time to really understand what PHPUnit is and get our tests wired up, we finally get a chance to look at the test we ran and watch it work. Woot!

Adding additional PHPUnit tests for our controller and 500 errors - 2:29

Well, we have one test working. Let’s add a couple more!

(FREE!) What the Event Dispatcher Symfony component does, and how to add it to our project - 2:29

In Drupal we have hooks that allow us to modify the path of processing for all kinds of things. We can adjust the content of forms, we can add pages to the menu system. In Symfony you can do the same thing with the Event Dispatcher component. In this video we talk briefly about what this component is all about.

How to add an event with the Event Dispatcher - 3:58

Before we can ‘listen’ for events, we have to set up an event. In this video, we create an event to allow us to modify the output of our pages before they get sent.

How to create an event class for our event - 2:18

It’s convention to create a class for each event to wrap around the variables passed to the event. Here we create that class.

April 15th, 2014

How to install PHPUnit on a Mac or Linux - 2:25

In this video, we install PHPUnit - the tool we’ll use to run PHP unit tests - on a Mac.

How to install PHPUnit on a Windows machine, what PEAR is and how it compares with Packagist - 5:09

Here we install PHPUnit on Windows using the PEAR package manager, and we do a short showdown on what make Packagist a better solution for most scenarios.

How to set up PHPUnit configuration and set up our first unit tests - 2:40

Now that we have PHPUnit set up, we set up a configuration file to tell PHPUnit where to find tests.

How setting up interfaces for your classes helps with unit testing - 3:57

We’ve run into interfaces a couple of times so far (interfaces are like scaffolding for any child classes), and in this video we discuss the advantages of using interfaces for PHPUnit tests.

(FREE!) What dependency injection is, and updating our framework to use interfaces - 2:05

In this video we briefly talk about what dependency injection is and why it makes sense, particularly for testable code. We also update our code to use the interfaces we talked about in the previous video.

April 8th, 2014

BuildAModule Mentored Trainings in New York, New Orleans and Chicago!

This last month Mentored Trainings were held before MidCamp in Chicago and the first ever DrupalCamp New Orleans, and this weekend there will be another to kick of DrupalCamp New York. From the feedback we've gotten for these and numerous Mentored Trainings over the years, they were an awesome way to jumpstart the camps. A couple quotes from MidCamp students:

"Class was very helpful and it's great to have so many experts in the room while trying to figure things out."

"I wasn't aware of BuildAModule and find it to have been a great resource. Thanks for a great experience and laid back format!"

Organizing a Mentored Training is actually pretty easy, and virtually anyone can do it. We've put together a set of resources on the Mentored Training page, and you can always contact us for more details. If you want to see first-hand just how amazing a Mentored Training can be, consider joining us at DrupalCon Austin coming up in June.

 

And 5 New Videos on Testing and PSR-0

How to add Composer autoloading for our custom code by making it PSR-0 compatible - 2:31

So far we’ve only used external libraries with Composer, but in this video we add the ability to be able to use the Composer autoloader with our own code. It’s super simple, will make your life easier, and instantly make your code reusable.

How to split up our leap year code into a controller class and a model class - 4:05

One of the principles of object orientation is that each class should have a single purpose. In this video, we restructure some of our code to use classes and put some of our leap year code into their own files.

Adding PSR-0 compatibility to our leap year code, and updating our app.php file - 2:33

In an earlier video, we saw how easy it was to add a PSR-0 folder to our autoloader, and here we do the same thing for our leap year code.

What unit testing is and how it can make your code better and more flexible - 1:43

Unit testing is a powerful and rapid way to automate testing and also insure your code is flexible enough to adapt to unanticipated situations. In this video we talk a bit about unit testing and its advantages.

(FREE!) The difference between unit testing, functional testing and regression testing - 3:11

If you haven’t really dived into testing your code, you may feel a little confused about the variety of tests out there. In this video, we clarify what the three most common ones you’ll run into are.

April 1st, 2014

Registration for our highly-rated, practical and super fun training is now open! To register you or your team simply click here to add the training to your DrupalCon cart, or learn a bit more about the structure of the training here. If you want to make a huge leap up the Drupal learning curve AND get 4 months BuildAModule access for free AND get access to some amazing Drupal trainers for one-on-one help, this is the training for you.

If you are part of a Drupal team that has recently standardized on Drupal across your organization, this training will help your team mobilize in the right direction, so consider having your team do the training together.

If you have any questions at all about the training, just send them our way.

Ticket sales go fast, so be sure to grab them before it's too late!

And 5 New Videos on Having Multiple Front Controllers in Symfony

Updating our routes and controller to use the controller resolver, and how type hinting works - 2:59

After setting up our controller resolver, we update our routes to point to a method in our controller class and update our controller.

(FREE!) How we can use multiple front controllers for different environments - 2:11

In this video, we look at the code in our front controller and see that it would actually be pretty useful for other applications as well. This code could actually be the basis for a framework class. By moving our code out of our front controller, we make it simple enough so that we could have multiple front controllers without much duplicated code. If you’re not sure why that would be useful, watch the video to find out!

Creating a reusable Framework class - 2:55

Here we do the grunt work of pulling the code out of our front controller and into a new Framework class.

Simplifying our front controller while leveraging our Framework class - 0:53

One our framework class is in place, we update our front controller to use it, greatly simplifying the code.

One minute of reassurance - 0:57

At this point, we’re looking at a front controller that sets up half a dozen different classes that are all kind of abstract and only make sense in a certain context. In this video, I offer some reassurance that it took me a few times going through this to really understand it, and that much of what we’re covering is merely building up to the concept of why a framework is useful, and that some of these components you won’t need to use in your daily life.

March 25th, 2014

For the third year in a row, BuildAModule will be offering our world-class training at DrupalCon. Last year it was one of the highest rated trainings, and this year we aim to make it even better! Registration will be available next week on April 1st, but we wanted to let you know now so you can be ready to sign up before it sells out. The course will is called "Drupal for Beginners", but all skill levels are welcome to join. In fact, the class will work even better with a wide variety of experience levels in the class. To get a sense of the structure of the class, you can read the outline from last year's training.

If you have any questions about the training, just respond to this newsletter. We'd love to have you and your team!

And of course, 5 NEW videos added in "Drupal 8 Developer Prep"

How to convert our pages to use a controller function - 5:16

We explored the idea of controllers in our object-oriented programming section, and here we put our knowledge to good use by creating a controller function to route our pages through.

Updating our routes to include a '_controller' attribute, and what a 'closure' or 'anonymous function’ is - 3:23

In the last video we created our controller function and updated our front controller to use it. In this video we finish up the process of converting to a controller by adding a new parameter to each member of our routing array.

Replacing our app with one that calculates leap years - 2:55

Our ‘hello’ and ‘bye’ pages were good to give our framework multiple pages to work with, but what happens when we have a more complicated application? In this step we replace our simple pages with a page that performs some actual calculations, and we’ll evolve it through the rest of the videos in the Symfony section.

(FREE!) How to create a controller class, and how to tell what are valid PHP callbacks - 2:47

In one of our previous steps we created a controller function to route all of our pages through. In this video we demonstrate how to build a real, genuine controller class (much like what you’ll see in Drupal 8).

How to use the controller resolver and install the Http Kernel component - 3:32

Now that we have our controller set up as a class, we’re going to use a controller resolver (part of the Http Kernel component) to allow for lazy-loading of our controllers. Lazy-loading is always kind of awesome.

March 18th, 2014

I am writing this newsletter after a whirlwind trip to Sweden for DrupalCamp Stockholm. What a beautiful country and awesome people. At the camp were representatives from at least 5 countries, all gathering to celebrate and learn more about Drupal. If any of our state-side members are considering traveling to Europe anytime soon, keep an eye out on the DrupalCamp calendar and consider coordinating your trip around a Camp. It's a great way to make friends and learn where the good restaurants are. ;-)

And 5 new videos this week

How to set up a file to store our routes and use the routing component - 3:23

Now that we have a routing component and are anticipating adding additional pages, it makes sense to split off our routes into a separate file. This will also clean up our front controller, and that will come in handy for purposes to be disclosed at a later time.

Updating our front controller to use the routing component - 2:37

After stashing our routes in their own file, we now need to update our front controller to use the new setup.

(FREE!) How a try ... catch block works and why you would want to use it - 3:04

If you’ve never seen a try … catch block before, it can seem a bit awkward. But, once you understand how it works, it will change the way you debug forever. In this video we go through the basics of using try, throw and catch, but we’ll come back and give the full run-down of try … catch soon.

An in-depth look at how to use try ... catch and throwing exceptions - 5:27

In our last video we explained the role of a try … catch block. In this video we dig deeper and look at the source of the objects that get passed around a try … catch block, how to throw exceptions that don’t get caught, and more.

How to use the routing component to gnerate URLs based on route name, and exploring additional methods of the Matcher class - 4:12

Now that we’re using the routing component, we take a look at a couple more perks we get by using it instead of our custom routing array, including building URLs from scratch knowing just the name of a route.

March 11th, 2014

In these next five videos we continue our dive into Symfony 2 - the framework that Drupal 8 leverages for important tasks like routing, dependency injection and various brands of object orientation. This week we convert our pages to template files and introduce the Routing component - something you'll find invaluable when working with Drupal 8.

Adjusting our pages to use the front controller, and how to add new pages - 2:21

Now that we have a front controller, we modify our ‘hello’ and ‘bye’ pages to leverage it.

Reorganizing our page files to make it easier to add new pages - 2:47

As we anticipate our application growing over time to include more pages, it makes sense to put them in their own directory. In this video we move those files around and update our code to pick up on the new location.

(FREE!) How to convert a PHP file into a template - 3:38

If you’ve ever wondered how templates work behind the scenes, this is the video for you. Here we being a two-part process of converting our PHP pages into HTML with a bit of PHP peppered in where we need dynamic values. It’s not too tough, and it’s a fun technique to incorporate with any simple PHP project.

How to use the extract() function to convert an array to string variables to use in a template - 5:16

In this video we make our template even more template-like by passing simple string variables in. For the magic of getting values out of our objects and into strings, we use the native PHP function, extract().

The weaknesses of our current routing strategy, how to update a Composer project and set up the routing component - 3:04

By this point, we’ve set up a pretty decent framework for our application. We have our routes distilled into an array and can easily add new pages. But, what if we want dynamic URLs that don’r rely on a particular file that has the same name? Exactly! So, in this video we install the Symfony routing component to beef up our routing.

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:

Syndicate content

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.