Category: PHP
How to Fix the ‘PHP Version Does Not Satisfy That Requirement’ Error in Composer for Drupal Projects
For those building Drupal websites, Composer is essential. It helps manage and add new website pieces, like modules and themes. But if you’ve ever felt lost about how Composer works, think of it as a helpful grocery shopper. Not sure about the analogy? Check out this article: “Understanding Composer: A Simple Analogy of Grocery Shopping…
How to Set Up Xdebug with DDEV in VSCode in 4 steps
How to Set Up Xdebug with DDEV in VSCode: In just four easy steps, enhance your coding and debugging experience in this popular editor, as detailed in this post. Xdebug is a debugging and profiling tool for PHP. It offers stack traces, variable inspection, and breakpoints, along with code coverage and performance profiling to optimize…
How to Remove Duplicates in Drupal Views with Taxonomy Relationships
When working with Drupal, one of the most powerful tools at our disposal is Views. It offers a flexible way to present content, especially when content is associated with taxonomies. However, sometimes we encounter an annoying issue: duplicates. I personally faced this challenge today. The Problem:I created a Drupal View named ‘resources’. In this view,…
Proxying Media Files in a Local WordPress Development Environment with DDEV
Proxying media files in a local WordPress development environment is an essential skill for developers who want to ensure that their local site reflects the content and functionality of the live production site. Downloading all the media files to your local environment might not be the best solution, especially if the production site has a…
How to Create and Use Drupal 8+ Services: A Detailed Guide with Practical Code
Drupal, the open-source content management system, has come a long way since its inception. With the release of Drupal 8, we saw a massive shift in the underlying architecture: the adoption of a more object-oriented programming approach using Symfony components. One notable component that was introduced in Drupal 8 is the service container, which has…
How to Efficiently Render HTML Markup in WordPress: A Practical Guide for Developers
Discover the power of template parts in WordPress and learn how to render HTML markup efficiently with our step-by-step tutorial. This comprehensive guide explores the benefits of using template parts, including modular code structure, reusability, and improved readability. Whether you’re a seasoned developer or just getting started with WordPress, this tutorial will provide you with…
What are the benefits of PHP 8.1 and the Commands to upgrade from an older version on Nginx?
PHP 8.1 is the latest version of the popular server-side scripting language, and it brings a host of new features and improvements that make it a compelling choice for developers. In this article, we’ll highlight some of the key benefits of upgrading to PHP 8.1.
How to add the logged-in user’s roles as classes in the body element in WordPress
To add the user roles to the body of your WordPress pages, you can use the body_class hook. This hook allows you to add custom classes to the <body> element of your pages. Example of body_class hook to add classes to the body element Here’s an example of how you can use this hook to…
Drupal 10, a quick overview
Drupal 10 is the latest version of the popular open-source content management system (CMS) Drupal, released on December 14th, 2022. It marks the culmination of over two years of development and brings with it numerous new features and improvements. One of the key features of Drupal 10 is its support for modern web development practices.…
How to step debug PHP code with Xdebug and PhpStorm on a DDEV setup
What is debugging? Per wikipedia: “In computer programming and software development, debugging is the process of finding and resolving bugs (defects or problems that prevent correct operation) within computer programs, software, or systems.” Per Internet: “Debugging is like being the detective in a crime movie where you are also the murderer.” – Filipe Fortes What…