Skip to main content

Articles tagged with "Symfony"

PhpStorm coding tip for Drupal services

29th Jun 2022

Here's a super simple tip to help you work with services for Drupal in PhpStorm (our favourite IDE). First, ensure you have enabled the Drupal Symfony Bridge and Symfony Support plugins; they're brilliant for auto-complete suggestions, and navigating around services, controllers, annotations and twig templates! I find it so helpful to be able to cmd+click (or ctrl+click) on a service name, whether in a YAML definition, or PHP code, and jump straight to the service class. But I'd noticed that PhpStorm often didn't recognise the method used after my code referred to a service like this:

\Drupal::service('my_service')
  ->something($id);
Read more

Replacing a vocabulary listing

29th Nov 2016

In a recent Drupal 8 project, one of the site's vocabularies had several thousand terms in it (representing airports), which caused its admin listing page to run out of memory before it could render. I wanted to solve this without affecting any other vocabularies on the site, and improve the listing itself along the way to be more useful, with filters to make searching it much easier. The original listing is not a view, and loads much more than it needs to. Here's the customised page for airports that I wanted to head towards:

Customised airports view

Read more