Skip to main content
Joachim's blog

Main navigation

  • Home
  • About

Breadcrumb

  1. Home

module builder

By joachim, Tue, 02/09/2025 - 13:17

The big plugin attribute change-over made easy

Attributes are here and they're great. I hated annotations; they were a necessary evil, but putting working code into comments just felt wrong.

Tags

  • module builder
  • plugins
  • Rector
  • deprecation
  • regex
By joachim, Thu, 24/10/2024 - 11:25

Changing your mind about dependency injection

When I start writing a class that has a dependency injection, I have a clear idea about which services it needs. I generate it -- the plugin, form, controller, or service -- and specify those services.

Then nearly always, unless it's something really very simple, I find that no matter how much I thought about it and planned it, I need to add more services. Maybe remove some too.

Fortunately, because Module Builder saves the configuration of the module code you've generated, it's easy to go back to it and edit it to add more services:

Tags

  • dependency injection
  • Drupal Code Builder
  • module builder
By joachim, Wed, 21/02/2018 - 21:52

Regenerating plugin dependency injection with Module Builder

Dependency injection is a pattern that adds a lot of boilerplate code, but Drupal Code Builder makes it easy to add injected services to plugins, forms, and service classes.

Tags

  • Drupal Code Builder
  • module builder
By joachim, Sun, 28/02/2016 - 23:28

Module Builder announces split, due to functionality differences

For Drupal 8, Module Builder is undergoing some big changes. It still builds hooks, a README file, an api.php file, permissions, an admin settings form, but now also builds plugins, services, routing items, and its ability to scan your codebase to learn about hooks invented by any of your modules is now extended to plugin types too. And it's actually been available for Drupal 8 for quite some time, but up till now only as the Drush plugin version.

Tags

  • module builder
  • Drupal Code Builder
By joachim, Tue, 19/08/2014 - 08:12

Getting Module Builder ready for Drupal 8

I've just made a commit to Module Builder that adds unit tests. This is a big deal, because having these frees me up to start making the big changes that are needed for supporting Drupal 8's new structures: routes, plugins, forms, and so on.

The biggest challenge is going to be the interface. Currently, you give Module Builder just a module name and a list of hook names, and it does the necessary. On the command line it's nice and simple:

Tags

  • module builder
By joachim, Tue, 18/08/2009 - 09:21

Never Write A Line Of Code Again!

Okay, so I lied. But module builder can save you a lot of time when writing custom modules.

And it now works with drush, too. I added support for drush a few weeks ago, which let you do things like "$ drush mb mymodule cron init menu nodeapi --write" and hey presto, a new module folder is created, with an info file and a module file, with hook implementations ready to do your (evil) bidding. (Note: this blog does not sanction use of Drupal, module builder, or drush for evil.)

Tags

  • drupal
  • 6.x
  • module builder
  • development
  • Drush
  • drupal planet
module builder

Frequent tags

  • Drupal Code Builder (9)
  • git (7)
  • module builder (6)
  • 6.x (5)
  • drupal commerce (4)
  • Composer (3)
  • Drush (3)
  • development (3)
  • Entity API (3)
  • Field API (3)
  • patching (3)
  • wtf (2)
  • contributing code (2)
  • code style (2)
  • contrib module (2)
  • maintaining projects (2)
  • debugging (2)
  • drupal.org (2)
  • tests (2)
  • multisite (2)
  • Drupal core (2)
  • core (2)
  • issue queue (2)
  • modules (2)
  • roadmap (2)
  • 7.x (2)
  • Rector (2)
  • developer tools (2)
Powered by Drupal