PageBuilder – custom content type, XML config, JS preview, frontend rendering
PageBuilder is Magento 2’s drag-and-drop content editor that replaced the plain HTML textarea in admin. A custom content type lets merchants create complex layouts without HTML knowledge while giving developers full control over the output. I show the complete implementation: XML configuration, JavaScript preview in admin, and frontend rendering.
- Published in Magento / Adobe Commerce
State pattern – order state machine, serialisation, comparison with Strategy
State is a behavioural pattern that allows an object to change its behaviour when its internal state changes. It looks like the object changed its class. The classic example is an order state machine – an order in “pending” status behaves differently from one in “processing”. I show an implementation in PHP and compare it with Strategy, which it superficially resembles.
- Published in Wzorce projektowe
PHP 8.3 preview – typed constants, json_validate(), array_find(), clone with
PHP 8.3 is due in November 2023 and while it is a conservative release compared to 8.0-8.2, it adds several things worth knowing about before they arrive. Typed class constants close an inconsistency in the type system. json_validate() saves a decode-and-discard pattern. array_find() and array_find_key() replace clunky array_filter() idioms. The readonly amendment allows re-initialisation in cloning.
- Published in PHP
Drupal 10 – Entity Types, hooks, DI, headless via JSON:API, comparison with WP and Magento
Drupal 10 is a significantly more modern platform than its reputation suggests. The rewrite to Symfony components, a proper DI container, and a composer-first approach happened years ago. Drupal 10 adds PHP 8.1+ requirements, drops old dependencies, and has CKEditor 5 and Olivero as defaults. I show Drupal 10 through the lens of a PHP developer familiar with Magento 2 and Symfony.
- Published in PHP
