Zend Framework Articles

Goodbye Master Zend Framework. So Long. Farewell.

Goodbye Master Zend Framework. So Long. Farewell.

April 8, 2020

It’s with some sadness, that earlier this week, I wished a fond farewell to the biggest blog I ever created, Master Zend Framework. Given that, it only feels right — and responsible — to talk about what motivated the decision to close the blog, and what the future holds for the blog’s content.

How To Simplify Zend Expressive Configuration with ConfigProviders

April 9, 2016

In any application there are a lot of moving parts, which can lead to a lot of complexity — especially when it comes to configuration. Given Zend Framework’s flexible nature, this can easily be the case — if we’re not careful — requiring a lot of supporting configuration. ConfigProvider classes, however, make managing application configuration very maintainable, even intuitive. This tutorial shows how to implement them.

Zend\Db\Sql\Select - The Basics (Columns, Limit & Order)

April 2, 2013

In part 3 of this series on \Zend\Db\Sql\Select in Zend Framework 2 We cover the constructor, columns function, aliases and expressions, finishing up with limit and order functions. Come wind up the series in style.

\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.

\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.

Using ZFTool for Basic Project Management

April 14, 2013

In today’s tutorial, we go through the key options in ZFTool, the tooling support available in Zend Framework 2. We install it, create a basic ZF2 application and more.

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>

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.

Why Kohana is an Excellent Alternative to Zend Framework

April 20, 2012

As you know from reading Malt Blue, I’m rather a Zend Framework fan. Whether it’s the controller plugins, easily adding RSS feeds to applications, configuration with Zend Config or more – I really believe it’s one of the best PHP framework choices. But well, it’s a bit heavyweight. Enter Kohana!

Why Zend Framework Plugins Save You Time

April 5, 2012

During the recent development of the new PHP cloud development casts site, which has been developed with the Zend Framework, so much development time has been saved by using one of the simplest and arguably best features of the framework: Controller Plugins. So today I want to introduce you to them and walk you through a working plugin so you can see just how effective and efficient they can make your development workflow.

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.

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="http://www.maltblue.com/2011/10/software-development/php/a-simple-bootstrap-for-the-zend-framework" 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="http://www.maltblue.com/2011/11/software-development/php/frameworks/zend-framework/zend-framework-bootstrap-made-simple-part-two" 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="http://www.maltblue.com/2011/10/software-development/php/a-simple-bootstrap-for-the-zend-framework" 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 Form - Multiple Submit Buttons

April 8, 2011

<p>Let me describe said situation for you; The user has a list of items and they’ve chosen to delete one. Given such a volatile action, you want them to <strong>doubly opt-in</strong> and confirm that they want to do this.</p> <p>The last thing you want your user to feel, after they’ve clicked the delete link, is “<strong>NO WAAAAAAIIIIT! I didn’t mean to do that</strong>”. So the user clicks &'<strong>delete</strong>&’ and is directed to a confirmation page (which is rendered with <em>Zend Form</em>). There are two buttons on the page; the first is “<strong>Delete Item</strong>”, the second “<strong>Cancel</strong>”.</p> <p>If the user clicks either button, the form submits to itself, where the value of the button clicked is determined. If the user clicks “<strong>Delete Item</strong>”, then the deletion is carried out, deleting the item from the datasource. If the user clicks “<strong>Cancel</strong>” the user is returned to the list of items they were previously viewing, the item is not deleted and the user is provided a message, confirming the non-deletion.</p>

Extending Zend Auth - A Zend Config Adapter

April 23, 2011

<p>So in <a href="http://www.maltblue.com/2011/06/tutorial/extending-zend-auth-a-test-adapter" title="Extending Zend Auth – A Test Adapter">the last installment</a> of this series, I provided an introduction to <em>Zend_Auth</em>, <em>Zend_Auth_Adapter_Interface</em> and Zend_Auth_Result and how to implement Zend_Auth_Adapter_Interface to implement a basic test adapter that can be used as a mock object in your testing.</p> <p>If you missed it, check it out now, then come back and we’ll continue on. If you’ve already read it, then let’s continue now.</p> <p>As I indicated last time, whilst being a perfectly valid implementation, the Test adapter was rather basic and didn’t do very much. Like all good testing, you need flexibility and options. So in this installment, we’re going to build an adapter based around Zend_Config. This will lead quite nicely in to the last part in the series which uses the wonderful MongoDB as the underlying resource for the adapter.</p>

Extending Zend Auth With A Test Adapter

April 21, 2011

Zend_Auth provides a very extensible workflow for creating new adapters to suit your authentication needs. In this post, I start you off with a simple Test/Mock adapter.

Scalable Logs with ZeroMQ and Zend Framework

April 20, 2011

Do you want a scalable, high performance PHP application that logs everything in an intelligible manner; in a manner that you can use now, tomorrow and three weeks from now? It’s so possible! In a series of posts, I am going to show you how to put it together using Zend Framework, ZeroMQ and Hadoop.

Extending Zend Auth — The HowTo Series

April 17, 2011

<p>Zend Auth, if you want to secure a Zend Framework app, along with Zend Acl, it’s essential. But do you know what it is? Do you know how to use it? Do you know how to extend it? Through this series I’m going to show you how to do all three.</p>

Internationalizing PHP Applications With TMX

April 14, 2011

phpMagazin recently did a good job of covering Zend_Translate; specifically what it is, how it works and four of the basic translation adapters; those being Array, CSV, Gettext and Ini. However, what they didn’t cover was what I think, is one of the best choices of adapters that Zend_Translate has; which is TMX.

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="https://github.com/coen-hyde/Shanty-Mongo" 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>

10 Reasons Why Zend Framework is a Mature Choice

April 13, 2011

Zend Framework, one of the big frameworks today. Is it the right choice, is it the wrong choice? We believe it’s one of the right choices for professional PHP development. Here’s 10 reasons why!

Zend Framework — 10 Must Dos

April 6, 2011

<p>The Zend Framework, whilst a great tool, is often slighted for being big and bloated.  Now I’m not contesting that, but it does have a heck of a lot going for it. So if you’re going get the most out of it, then you need these 10 tips.</p>

Zend Framework, a Truly RAD Framework!

April 24, 2011

Like any profession or trade, you can spend years refining your craft; always looking for the path of least resistance; the path of greatest simplicity, which leads to your goals in the shortest time and the least amount of effort. Especially in software development, you try to simplify and automate as much as you can. Not only do you save unnecessary time, but you get to devote your energies to the most meaningful aspects; the areas that bring greatest productivity and satisfaction to you and your client or employer.

Writing a Secure, RESTful Service in Zend Framework (Part 2)

April 25, 2010

In this article, a follow up to writing a secure, Restful service with the Zend Framework, I’m going to cover the HTTP status codes that you should use, where and when. The reason for this is that they’re a fundamental aspect of the interaction with the service. You get this right and you will make it so much better for clients to use your service; you get it wrong and you may only have a few users and they may do a lot of work for very little gain.

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.

Do you i18n?

April 5, 2010

<p>What’s your attitude to <strong>i18n</strong>? Are you not quite sure what i18n is? Well, according to <!-- raw HTML omitted -->Wikipedia<!-- raw HTML omitted -->, it’s:</p> <blockquote> <p><strong>Internationalization</strong> is the process of designing a software application so that it can be adapted to various languages and regions without engineering changes. <strong>Localization</strong> is the process of adapting internationalized software for a specific region or language by adding <a href="/wiki/Locale" title="Locale">locale</a>-specific components and translating text.</p> </blockquote>

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.

JSON, XML, RSS, CSV - it's all a ContextSwitch away!

April 19, 2010

<p>Do you love the variety of formats that you can publish and subscribe to in this veritable golden-age of computing we’re enjoying? Same here. Whether it’s JSON, <!-- raw HTML omitted -->XML<!-- raw HTML omitted -->, <!-- raw HTML omitted -->RSS<!-- raw HTML omitted -->, Atom, CSV or even Excel format, there’s just so much choice.</p> <p>The challenging thing is that though there’s so much choice of format, there are also so many demands to use them - ALL. So what do you do when your boss, client, friend, family-member (<em>whom you’re the technical support person for</em>) requests this for their blog or site?</p>