Category: httpkernel

Disco with Design Patterns: A Fresh Look at Dependency Injection

Dependency Injection is all about code reusability. It’s a design pattern aiming to make high-level code reusable, by separating the object creation / configuration from usage.Consider the following code: <?phpclass Test {protected $dbh;public function __construct(PDO $dbh) { ...

From Request to Response: A Journey into Drupal 8 Internals

In the first article on Drupal 8 module development we looked a bit at the routing aspect of this process. We’ve seen that creating pages with paths is now a matter of declaring routes that match up with controllers. The latter, as we’ve seen, can return a render array that gets interpreted into markup and displaye...