Intermediate Articles

Howto Use Constructor Injection In ZF2

April 15, 2014

Is it right to use setter injection? Or is it evil, to be avoided at all costs, for the explicitness of constructor injection? In today’s post, we explore that and how to implement constructor injection in ZF2 controller classes.

HowTo Use Child and Segment Routes to Build Simple Routing Tables

April 3, 2014

<p><!-- raw HTML omitted -->Routing is one of the key requirements in modern applications, especially in Zend Framework 2; but they shouldn’t be overly-complicated. Today, we’re going to look at how to build a routing table, simply and easily using child and segment routes.</p>

Make Module Configs Cacheable with the ZF2 Factory Interface

April 6, 2014

<p>For the longest time, I’ve been using closures in my Zend Framework 2 Modules <!-- raw HTML omitted -->Module<!-- raw HTML omitted --> class. I know they’re not always the best approach, but they’re not necessarily wrong either.</p> <p>But after <a href="http://www.masterzendframework.com/reviews/maximising-zend-framework-2-performance-phpuk14">reviewing Gary Hockin’s recent talk</a> at <!-- raw HTML omitted -->PHP<!-- raw HTML omitted --> Conference UK, I was reminded that outside of APC and OPCache, <strong>closures aren’t cacheable</strong>.</p>

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 - Build SQL Where Clauses Easily and Efficiently

April 20, 2013

In this tutorial we’re working through the basics of \Zend\Db\Sql\Where, showing how to build SQL Where clauses for database queries. We’ll show how to create different predicates from simple to nested queries using of and, or, like, between and in conditions.

Zend Framework 2 - Hydrators, Models and the TableGateway Pattern

April 15, 2013

<h2 id="synopsis">Synopsis</h2> <p>Zend Framework 2 comes packed with an assortment of new features and functionality and greatly streamlines how common scenarios, such as interacting with datasources and application configuration and caching are implemented.</p> <p>Whether it’s <a href="http://www.masterzendframework.com/tutorial/zf2-html5-form-field-introduction" title="Zend Framework 2 – The New HTML5 Form Fields">the new HTML5 form elements</a> and view helpers, the new implementation of <a href="http://framework.zend.com/manual/2.1/en/modules/zend.http.html">Zend\Http</a>, the Service Manager, the Event Manager or that <a href="http://www.masterzendframework.com/tutorial/zend-framework-2-modules-the-applications-heart">Modules are now first-class citizens</a> - you can’t help but see that it’s bursting at the seams.</p>

Zend Framework 2 Forms - Simple and Available Everywhere

April 4, 2013

In Zend Framework 2, so much has been changed, updated and improved - with Forms receiving a lot of attention. In this post, I show you a simple, flexible and powerful approach to compose and use them everywhere in your applications.

Zend ServiceManager - Web Application Development Simplified

April 30, 2013

The Zend ServiceManager simplifies the web application development process by making configuration a breeze. In this, the 4th post introducing Zend Framework 2, you will learn what the ServiceManager is how to use it and how it simplifies applicaiton development time.

Zend Framework 2 Modules - The Application's Heart

April 2, 2013

<p><a href="http://www.masterzendframework.com/wp-content/uploads/2013/01/Post-Image.jpg"><!-- raw HTML omitted --></a></p> <!-- raw HTML omitted --> <blockquote> <p>If I have seen further it is by standing on the shoulders of giants.</p> </blockquote> <p>It’s a really exciting time at the moment with Zend Framework 2 gaining so much traction, after being stable for some time now.</p> <p>Though I and countless others really enjoyed the 1.x series, it did leave some things to be desired - to be fair.</p> <p>But the more I explore of the 2.x series, the more I honestly can say that I’m very impressed with it. It may not be as fast as the previous series, but with respect to development, there’s so much going for it it’s worth shouting about.</p> <p>So it really is rewarding and exciting to begin covering all that it has to offer us. In <a href="http://www.masterzendframework.com/articles-2/zend-framework-2-core-concepts-understanding-dependency-injection">part one of this series</a>, I looked at a central concept of the revised framework - <strong>Dependency Injection</strong>.</p>

Painless Data Traversal with PHP FilterIterators

April 25, 2012

There’s load of ways to traverse data, especially in PHP where there are a variety of loops available; including while, do while, for and foreach. These are fine for normal structures, such as scalar and associative arrays. But what if you want to get a bit more fancy? Enter the FilterIterator

How to Use the Zend Form ViewScript Decorator In All Modules

April 8, 2012

If you’ve been using Zend Forms for any length of time, you’ll know just how flexible and configurable they are. There’s not much that you can’t do with them, But it’s not always easy and there are catches. Today we look at ensuring that module-based Zend Forms using the ViewScript decorator can always be initialised no matter what.

Zend Form Mastery with Zend Config – Part 4 Configuring Zend Validators

April 5, 2012

Welcome to the fourth and final part in the Zend Form Mastery with Zend Config series. Previously we looked at the basic form options, element and form wide prefixes, filters and element options. In this installment, we’re going to look at configuring Zend Validators via our XML config.

Zend Form Mastery with Zend Config – Part 3 Standard Form & Element Options

April 22, 2012

– Part 3 Standard Form & Element Options Options We’ve looked at custom form filters and we’ve looked at the core form configuration. But what about the other form properties? What about: setting an element as readonly an element as required ignoring an element and love them or hate them, what about decorators Element Options Outside of the options that we’ve looked at previously, there are a number of other options that we can consider implementing when configuring a Zend Form.

Zend Form Mastery with Zend Config - Part 1 Custom Filter Paths

April 27, 2012

When you’re working with Zend Form you keep your configuration as much out of code as you can - right? Well, if you’ve been working withZend Form for more than a little while, you know that Zend Config really makes that pretty simple - well, some of the time. In this series we look, comprehensively at how to do it all with Zend_Config.

Beginning cloud development with cloudControl – Part 4 – Memcache

April 9, 2012

<p>Here we are at part four of the <em><strong>Beginning Cloud Development with cloudControl</strong></em> series and in this part, we’re adding <strong><a href="http://uk3.php.net/manual/en/book.memcached.php" title="php Memcached">Memcached support</a></strong>. In <a href="http://www.maltblue.com/php/beginning-cloud-development-with-cloudcontrol" title="Beginning cloud development with cloudControl">part one of the series</a>, we laid the foundation for the application and got up to speed with what <a href="http://cloudcontrol.com/?utm_source=maltblue&utm_medium=Banner&utm_campaign=MaltBlue" title="cloudControl: web - application - platform">cloudControl</a> is, why it works and how to get started using it.</p> <p>Then <a href="http://www.maltblue.com/php/beginning-cloud-development-with-cloudcontrol-part2-mysql" title="Beginning cloud development with cloudControl – Part 2 – MySQL">in part two</a>, we started to flesh out the application that we started building in part one and added MySQL support to it. We showed how to work with cloudControl to manage the key requirements, such as enabling MySQL support, connecting to the MySQL database and keeping the database up to date from a maintenance perspective (creating the database schema and loading data in to the database).</p> <p>Then in <a href="http://www.maltblue.com/php/beginning-cloud-development-with-cloudcontrol-part-mongodb" title="Beginning cloud development with cloudControl – Part 3 – MongoDB">the third part of the series</a>, we replaced MySQL with mongoDB support. Now, in this, the third part of the series, we’re going to finish up with adding <strong><a href="http://uk3.php.net/manual/en/book.memcached.php" title="php Memcached">Memcached support</a></strong>. As the core of the work’s already been done in the application, this tutorial will be shorter and simpler than the previous three. So, get out the code that you worked through from <a href="http://www.maltblue.com/php/beginning-cloud-development-with-cloudcontrol-part2-mysql" title="Beginning cloud development with cloudControl – Part 2 – MySQL">part 2</a>, or download a copy of it from <a href="https://github.com/maltblue/cloudcontrol-project" title="Malt Blue on github">the github repository</a> and let’s get started.</p>

Beginning cloud development with cloudControl – Part 3 – MongoDB

April 2, 2012

<p>Here we are at part three of the beginning cloud development with cloudControl series and in this part, we’re adding <strong>mongoDB support</strong>. In <a href="http://www.maltblue.com/php/beginning-cloud-development-with-cloudcontrol" title="Beginning cloud development with cloudControl">part one of the series</a>, we laid the foundation for the application and got up to speed with what cloudControl is, why it works and how to get started using it.</p> <p>Then <a href="http://www.maltblue.com/php/beginning-cloud-development-with-cloudcontrol-part2-mysql" title="Beginning cloud development with cloudControl – Part 2 – MySQL">in part two</a>, we started to flesh out the application that we started building in part one and added MySQL support to it. We showed how to work with cloudControl to manage the key requirements, such as enabling MySQL support, connecting to the MySQL database and keeping the database up to date from a maintenance perspective (creating the database schema and loading data in to the database).</p> <p>In this, the third part of the series, we’re replacing MySQL that we introduced in part two with mongoDB support.</p>

Beginning cloud development with cloudControl - Part 2 - MySQL

April 16, 2011

<p><!-- raw HTML omitted -->In <!-- raw HTML omitted -->part one of the series<!-- raw HTML omitted --> we got a birds eye view of a great cloud development solution for <!-- raw HTML omitted -->PHP<!-- raw HTML omitted --> - <!-- raw HTML omitted --><!-- raw HTML omitted -->cloudControl<!-- raw HTML omitted --><!-- raw HTML omitted -->. We looked at the concept of what it is, what you can do with it and ran through a basic deployment with a rather basic application. If you missed the first part, I strongly encourage you to read it before continuing on with part two. When you’re done, come on back and work through it here.<!-- raw HTML omitted --></p> <p><!-- raw HTML omitted -->In this, part two of the series, things start to get more serious. <!-- raw HTML omitted -->In this part, we’re going to start to flesh out the application started in part one, adding in MySQL support - showing just how simple cloudControl makes this for us.</p>

Beginning cloud development with cloudControl

April 8, 2011

<p>##.</p> <p>Don’t forget to grab the other parts as well:</p> <ul> <li><a href="http://www.maltblue.com/php/beginning-cloud-development-with-cloudcontrol-part2-mysql" title="Beginning cloud development with cloudControl – Part 2 – MySQL">Beginning cloud development with cloudControl – Part 2 – MySQL</a></li> <li><a href="http://www.maltblue.com/php/beginning-cloud-development-with-cloudcontrol-part-mongodb" title="Beginning cloud development with cloudControl – Part 3 – MongoDB">Beginning cloud development with cloudControl – Part 3 – MongoDB</a></li> <li><a href="http://www.maltblue.com/zend-framework/beginning-cloud-development-with-cloudcontrol-part-4-memcache" title="Beginning cloud development with cloudControl – Part 4 – Memcache">Beginning cloud development with cloudControl – Part 4 – Memcache</a></li> </ul> <hr> <p>So you’ve heard all about the cloud. In the current day and age, you’d have to be living under a rock to have not encountered it by now. Whether it’s the ads from <em>Amazon</em>, <em>Rackspace</em> or <em>Microsoft</em>, the extensions to your favourite framework, such as <em>SimpleCloud</em> in Zend Framework or <em>iCloud</em> from Apple – <strong>The Cloud is Everywhere!</strong></p> <p>But these aren’t the only options available to us as developers. In this series I want to introduce you to and help you get started with another cloud service - <a href="http://cloudcontrol.com/?utm_source=maltblue&utm_medium=Banner&utm_campaign=MaltBlue"><strong>cloudControl</strong></a>.</p>