Pragmatism in the real world

10 years since my ZF Tutorial

Incredibly, it's been 10 years since I announced my Zend Framework 1 tutorial! The first code release of Zend Framework (0.1.1) was in March 2006 and I wrote my tutorial against 0.1.5. Just under a year later, in July 2006, version 1.0 was released and I updated my tutorial throughout all the releases up to 1.12. ZF1 had a good run, but all good things come to an end and the official end of life… continue reading.

PHPUK 2016: Introducing Zend Framework 3

ZF3 is the framework that took the opportunity to learn from the previous 4 years of ZF2 and be even better than that! Today's PHP projects are built of components installed via Composer and ZF3's architecture reflects this approach; its core components have also been greatly improved in both usage and performance from older versions of the framework. If you're already running a ZF2 application, you'll be able to upgrade your existing application and there… continue reading.

PHPNW 2015: A first look at ZF3

Zend Framework 3 is the framework that took the opportunity to learn from the previous 4 years of ZF2 and be even better than that! Today's PHP projects are built of components installed via Composer and ZF3's architecture reflects this approach; its core components have also been greatly improved in both usage and performance from older versions of the framework. If you're already running a ZF2 application, you'll be able to upgrade your existing application… continue reading.

PHP Oxford 2015: A first look at ZF3

Zend Framework 3 is the framework that took the opportunity to learn from the previous 4 years of ZF2 and be even better than that! Today's PHP projects are built of components installed via Composer and ZF3's architecture reflects this approach; its core components have also been greatly improved in both usage and performance from older versions of the framework. If you're already running a ZF2 application, you'll be able to upgrade your existing application… continue reading.

ZF2 validator message keys

In Zend Framework 2, if you define your input filter via configuration, then you can override validation messages using a format along the lines of: <validators> <notEmpty> <messages> <isEmpty>Please provide your telephone number</isEmpty> </messages> </notEmpty> </validators> Setting the message is easy enough, once you have the correct key name. This is a list of all the keys for the standard validators: Validator Key name Default message Alnum alnumInvalid Invalid type given. String, integer or float… continue reading.

Routing to a controller with Slim 2

In a couple of projects that I've written using Slim Framework 2, I've found it beneficial to organise my code into controllers with injected dependencies; probably because that's how I'm used to working with ZF2. To make this easier, I've written an extension to the main Slim class and packaged it into rka-slim-controller which will dynamically instantiate controllers for you for each route. Defining routes is exactly the same as normal for a Slim controller,… continue reading.

Validating JSON with ZF2's Zend\Validator

Let's say that you have an admin form where the user can enter JSON and you'd like to validate that the JSON parses before allowing the user to submit. To do this, you can use the rather excellent jsonlint project by Jordi Boggiano. Obviously, add it via Compser :) Usage is simple: use Seld\JsonLint\JsonParser; use Seld\JsonLint\ParsingException; $parser = new JsonParser(); $result = $parser->lint($json); if ($result instanceof ParsingException) { // $json is invalid JSON } We… continue reading.

My "new" blogging habit

I've just come across Andy Baio's Middling post and this bit really resonated with me: Twitter and Waxy Links cannibalized all the smaller posts, and as my reach grew, I started reserving blogging for more "serious" stuff — mostly longer-form research and investigative writing. From around September 2013, I found that I was in this situation. I was only posting here once or twice a month, mainly as I felt that I should only blog… continue reading.

PHP Conference Argentina 2014: Introduction to ZF2

Zend Framework 2 has matured nicely over the last 6 months, so this talk looked at how it works! In this talk, I walked through the structure of a ZF 2 application. I covered configuration, service location, modules, events, and the MVC system to provide a clear introduction to the key elements of a Zend Framework 2 application.

ZendCon 2014: Dependency Injection in ZF2

The Dependency Injection pattern separates the creation of objects and their dependencies. This session will look at what Dependency Injection is, how it is integral to Zend Framework 2 and the benefits that it brings. We’ll then look at how Zend\ ServiceManager works and how to make best use of it within your application.