Skip to main content
Start of main content.
Lee Rowlands headshot

Lee Rowlands

Senior Developer

Location
Bundaberg
Drupal.org
larowlan
Social
larowlan

Lee has 22 years professional development experience with PHP, is a member of the Drupal.org security team and maintains the forum, comment, contact, contextual and block content modules in Drupal core along with at least 30 contrib projects. He is also the framework manager for core.

My blog posts

Making Drupal 8's menu active trail consider query arguments

On a recent Drupal 8 client project our client was building listing pages using views exposed filters and adding these to the menu.

This resulted in several menu URLs pointing to the same base path, but with the query arguments determining the difference.

However Drupal 8's default menu-trail calculation was resulting in the menu highlighting all instances when one of them was viewed.

Luckily the active trail calculation is done in a service and it was simple to modify the default behaviour.

Read on to see how we did it.

by lee.rowlands /

Overriding services in Drupal 8 - advanced cases

Drupal 8 comes with a services based architecture allowing clean dependency injection, separation of concerns and another way to modify how Drupal works without hacking core

You've probably heard that Drupal 8 lets you swap out a core service for your own implementation, hey, I even said it myself here and here, but how do you achieve that?

Read on to find out how to manipulate Drupal 8 services at run-time and how this compares to other popular PHP Frameworks like Laravel, Silex and Symfony

by lee.rowlands /

To Alter or Dispatch: Drupal 8 Events versus Alter Hooks

Drupal 8 comes with two extension points for module developers to allow other modules to interact with their code.

The trusty alter hook, the linchpin of Drupal versions past is still there - allowing other modules to interact and intervene in the behaviour of your module.

But there is a new kid on the block, the event system.

So as a module developer how do you decide whether to use the alter system or the event system.

by lee.rowlands /

Drupal 8 Now: PSR-0 code in Drupal 7

Drupal 8 embraces modern PHP with all the trimmings, shedding the baggage of supporting earlier PHP versions and embracing the new object-oriented features.

One such feature is namespaced objects and the PSR-0 standard for autoloader compatability.

But if you know your project will run on a recent version of PHP, there's no reason you can't write your custom modules using PSR-0 now, in Drupal 7

by lee.rowlands /