Master Zend Framework Articles

What Are Delegator Factories and Why You Should Use Them

April 26, 2018

Ever wanted to dynamically expand the functionality of an object which you retrieve from your dependency injection container, based on different needs, yet without creating messy, hard to maintain configurations? Then you’re going to want to know about a powerful new technique - called Delegator Factories.

How to Create a Zend Expressive Module

April 25, 2017

Ever thought of creating a Zend Expressive module, one that either scratches an itch or allows you to use a set of related functionality across multiple Zend Expressive projects? I created one recently and share how I did it with you in this three-part series.

Visual Debt. Really?

Visual Debt. Really?

April 14, 2017

Recently, Jeffrey Way dateed what’s become quite a controversial video in the PHP community on Laracasts, discussing a concept called Visual Debt.

Deploying With Docker - Take 1, Or "Houston, We Have a Problem"

Deploying With Docker - Take 1, Or "Houston, We Have a Problem"

April 3, 2017

A little while ago, I wrote two parts in a multi-part series about using Docker. As someone who’s reasonably new to Docker — <strong>and</strong> been bitten by the Docker bug — I wanted to share what I’d learned, in the hopes that others may benefit.

How to Build a Docker Test Environment

April 27, 2016

Docker makes it easy to build local development environments. But, what about being able to build test environments and run acceptance, unit, functional, and other types of tests? In this, the second part of the developing with Docker series, I’ll show you how to implement testing using PHPUnit and Codeception in the configuration which we’ve built.

How to Simplify Development with the Repository Pattern

April 23, 2016

In a recent application I found that I was too bound to a database as the application’s data source and wanted to decouple from it as much as possible, whilst using the least amount of effort. During research into the required changes, I came across an excellent pattern which gives a lot of flexibility, yet which doesn’t require a lot of code - it’s called the repository pattern.

How to Edit Consistently Using EditorConfig

April 18, 2016

When working with other developers on a project, editor and IDE differences, whilst not fatal, can be annoying, and even violate group coding standards. Put an end to that by using EditorConfig.

Howto Handle External Form Element Dependencies with FormElementManager

April 22, 2014

Zend Framework 2, like all great PHP frameworks, provides thorough infrastructure for creating forms in your application. Whether that’s form objects, form elements, fieldsets, validation groups or that they interact with so many other components in the Zend Framework 2 default libraries. But how do you handle external dependencies?

Easy Setter Injection in Zend Framework 2

April 29, 2014

Want to learn how to have initialized objects with minimal code and nearly no hands-on configuration in Zend Framework 2? Come learn about setter injection.

\Zend\Db\Sql - Creating Joins and Unions with Ease

April 27, 2013

In part two of the \Zend\Db\Sql\Select series, we create inner, outer, left and right joins as well as union queries with ease. Come learn more about building queries simply, effectively and easily in your every day applications with Zend Framework 2.

Rename uploaded files with Zend Framework

April 15, 2011

<p>Recently I was asked how to rename a file with the Zend Framework that used a Zend Form and Zend File element. They key requirement was that it should not be a hack or a kludged solution. So I thought I’d write a quick post to provide a simple example on how it was achieved.</p>

The Zend Framework Bootstrap made simple (Part 3)

April 9, 2011

<p>Ok, we’ve established that with the Zend Framework, we need to do a bit more work than some of the other frameworks to get up to speed - but that’s not necessarily a bad thing - right?! But it can be a bit tedious and it’s something as professional developers, we want to automate away. So we’ve been addressing in this series how to do just that with a custom, extendable bootstrap class.</p> <p>In the <a href="" title="A Simple Zend Framework Bootstrap">first part of the series</a> we laid the foundation of our custom bootstrap class by creating a custom class directory structure, adding its namespace to the application ini and modifying the default application bootstrap so that it extends from it and had a look at the first component - caching.</p> <p>Then, in <a href="" title="The Zend Framework Bootstrap made simple (Part 2)">the second part of the series</a>, we built on the foundation laid in part one by creating plugin resources for the <em>routing table</em>, <em>application navigation</em> and the <em>database connections</em> - these being some of the most common tasks, usually, associated with a web-based application.</p> <p>In this, the third and final part of the series, I’m going to finish up by looking at application placeholders and surprise, no not logging as originally promised, but <em>pagination</em>. As an added extra, we’re going to be using a <em>key feature</em> of Zend Application to make it a breeze.</p>

The Zend Framework Bootstrap made simple (Part 2)

April 2, 2011

<p>In the <a href="" title="A Simple Zend Framework Bootstrap">first part of the series</a>, you’ll remember that we laid the foundation of our custom bootstrap class by creating a custom class directory structure, adding its namespace to the application ini and creating our custom bootstrap file that our application bootstrap will extend from.</p> <p>After we did that, we put in the first but arguably the most important plugin resource – caching and stored it in the application registry. In this post we’re going to be building on that work and adding in three new plugin resources: routing, navigation and databases.</p>

The Zend Framework Bootstrap Made Simple (Part 1)

April 27, 2011

<p>When you’re creating a new project with the Zend Framework, unlike other frameworks, you need to do more legwork. This isn’t necessarily a bad thing, but it can sure slow you down when you’re trying to plough through a project.</p> <p>I really enjoy using it, as it has a very well structured approach – and I like structure – it clearly lays out a file-system structure for <em>modules</em>, <em>controllers</em>, <em>actions</em>, <em>forms</em>, <em>models</em> and so on. It has good, but basic, tooling, allowing for modest project initialisation. But despite all this, it still requires a healthy investment on our part to get a proper foundation in place to use it productively.</p> <p>In a recent project I encountered this situation and felt that I mustn’t be the only one to do so. As I plan to keep using Zend Framework I want to work around this situation and get as much productivity out of it as possible right from the get go. But how to do this?</p> <h2 id="bootstrapping">Bootstrapping</h2> <p>Well the primary focus for me is bootstrapping. It provides the majority of the core services that every project needs, from routing, data source connections, authentication, authorisation, navigation, caching and so on. So it stands to reason that it’s a good place to start. So I want to cover what should go in to a good working bootstrap.</p>

Zend Framework and mongoDB – Getting Started Quickly!

April 9, 2011

<p>This is a mini-post showing you how to get up and running with <strong>mongoDB</strong> and <strong>Zend Framework</strong> using a series of third-party libraries, including <strong><a href="" title="The Shanty-Mongo Zend Framework MongoDB library by Coen Hyde">Shanty-Mongo</a></strong> library. To be honest, it’s rather trivial, but sometimes it can be frustrating trying to find a simple, concise, reference on how to do it, specific to just your needs.</p>

Writing a Simple Blog With Zend Framework and MongoDB

April 7, 2010

I’ve been using mongoDB and Zend Framework to make a simple, replicatable filesystem. As it went well, I thought that I could quickly apply what I’d done to create an ultra-simple blog system. Read on to find out all about it.

How to Write a Secure RESTful Service in Zend Framework

April 5, 2010

So you’re up with the RESTful buzz but you’re concerned about security; as you should be! So what do you do? Well, like all good OOP practitioners, you don’t reinvent the wheel. As Steve Jobs said, “Good artists create, Great artists Steal”, or borrow in our case. So let’s look at the Amazon S3 model and implement that with our framework of choice - Zend Framework to protect your RESTful services.