At Drupalize.Me, one of our goals is to provide learners with up-to-date resources that align with the latest best practices. To that end, I recently worked to update our tutorials to reflect the transition from PHP annotations to PHP attributes for plugin discovery. I blogged previously about why this transition is happening.
As Drupalize.Me’s tutorial library continues to grow, these kinds of changes touch ever larger numbers of existing tutorials. Plugins is an interesting one because we have tutorials that teach the inner workings of the Plugin API. And, we have tutorials about things like blocks, field types, and views plugins, that while not specifically about the Plugin API, make use of it. This ended up being one the most significant updates we’ve made since the release of Drupal 8.
In short, the updates are necessary because Drupal is transitioning from annotations to native PHP attributes. And while annotations will continue to work for the foreseeable future, we wanted to make sure that the code examples, and recommendations, you find on our site are aligned with that code you’ll see in the latest versions of Drupal core.
Drush Custom Command Tutorials Updated
Blog postWe updated our Drush tutorials to be inline with current best practices around the use of PHP attributes and autowiring dependencies. This post looks at the changes we made, and the work required to keep these resources up-to-date for our members.
Test Custom Code
GuideNew and Updated Tutorials for Drupal 11
Blog postWe've added a new tutorial, Upgrade to Drupal 11. And, we've updated all tutorials and code in our Module Developer Guide for compatibility with Drupal 11.
Keep Drupal Up-To-Date
GuidePerformance and scalability determine how fast your application can serve a page and to how many users at a time.
Twig is a template engine for PHP, which is the language used in Drupal. Twig can be used to design templates in generic PHP applications as well as Drupal themes.
PHP namespaces provide a way in which to group related classes, interfaces, functions and constants. Drupal uses PSR-4 namespaces to autoload the correct PHP class from a file, accommodating variations in site structures.
Web services allow two or more applications to share data and instructions with one another across the Internet.
The Migrate API can be used to import content from an older Drupal site (Drupal 7 or older), or any other data source, into the current version of Drupal.
Use the Configuration API to access configuration data stored by a module, provide default configuration, create settings forms, and other tasks such as overriding settings for a local environment.
Caching in Drupal
TopicCaching in Drupal is controlled by Drupal's Cache API which is used to store any type of data on a permanent or temporary basis. Some types of data tend to take a long time to compute, but utilizing the Cache API in your module can help your site load data more quickly.
Have you ever wondered "What is the difference between cache keys and cache tags?" One of our Drupalize.Me members wrote in asking about it, and the answer provides insight into how Drupal's Cache API works.