Search results

From the blog

Posted 2019-12-05
More Changes Coming for the Laminas Project

Progress has been happening at a furious pace on the Zend Framework to Laminas transition, with major changes still dropping even now.

Most recently, we decided to rename the subprojects. Apigility will become the Laminas API Tools, and Expressive will become Mezzio.

For more background, read the Zend by Perforce blog post.

From the blog

Posted 2019-09-03
Looking For A New Adventure

Update

As of 2019-10-01, I am once again employed full-time. Thank you everyone who reached out!

Fourteen years ago, almost to the day, I received a job offer from Zend to join their nascent eBiz team, where I started contributing almost immediately to the yet-to-be-announced Zend Framework. Two years later, I joined the Zend Framework team full-time. A year later, I was promoted to Architect. A year after that, I was promoted to Project Lead of Zend Framework, a role I kept for the next ten years. Over the years, Zend was acquired by RogueWave Software, which was in turn acquired by Perforce earlier this year.

Two months ago, almost to the day, was my last day with Zend/RogueWave/Perforce.

I'm now looking for a new adventure.

From the blog

Posted 2019-04-17
From Zend Framework To The Laminas Project

Ten years ago this month, I was involved in a couple of huge changes for Zend Framework.

First, I helped spearhead integration of the JavaScript library Dojo Toolkit into Zend Framework, and finalized the work that month. I'd worked closely with the two developers who had been leading that project at the time, and one thing that came up during our discussions was that they had helped create an open source foundation for the project, to ensure its continuity and longevity, and to ensure the project can outlive the ups and downs of any commercial company. This idea intrigued me, and has stuck in the back of my mind ever since.

The other thing that happened that month was that I was promoted to Project Lead of Zend Framework. I've held that position ever since.

Today, I get to announce another change: Zend Framework is transitioning to an open source project under the Linux Foundation!

From the blog

Posted 2018-10-17
The Future of Zend Framework

For the past thirteen years, I've been either consuming Zend Framework or directly contributing to it. Since 2009, I've operated as project lead, and, since then, shepherded the version 2 and 3 releases, added Apigility to the ZF ecosystem, and helped bring middleware paradigms to the mainstream by assisting with the creation of Stratigility and coordination of the Expressive project. As I write this, the various ZF packages have been downloaded over 300 MILLION times, with 200 million of those being in the past 18 months!

From the blog

Posted 2016-08-17
Using Composer to Autoload ZF Modules

One aspect of Zend Framework 3, we paid particular focus on was leveraging the Composer ecosystem. We now provide a number of Composer plugins for handling things such as initial project installation, registering installed modules with the application, and more. It's the "more" I particularly want to talk about.

From the blog

Posted 2016-05-16
Programmatic Expressive

Enrico just returned from phpDay, where he spoke about Expressive and the upcoming Zend Framework 3. One piece of feedback he brought back had to do with how people perceive they should be building Expressive applications: many think, based on our examples, that it's completely configuration driven!

As it turns out, this is far from the truth; we developed our API to mimic that of traditional microframeworks, and then built a configuration layer on top of that to allow making substitutions. However, it's not only possible, but quite fun, to mix and match the two ideas!

From the blog

Posted 2016-04-26
On Deprecating ServiceLocatorAware

A month or two ago, we pushed a new release of zend-mvc that provides a number of forwards-compatibility features to help users prepare their applications for the upcoming v3 release.

One of those was, evidently, quite controversial: in v3, zend-servicemanager no longer defines the ServiceLocatorAwareInterface, and this particular release of zend-mvc raises deprecation notices when you attempt to inject a service locator into application services, or pull a service locator within your controllers.

The arguments go something like this:

  • "Dependency injection is too hard to understand!"
  • "This feature simplifies development!"
  • "If this is so bad, why was it in there in the first place?"

These are usually followed by folks:

  • saying they'll switch frameworks (okay, I guess?);
  • asking for re-instatement of the feature (um, no);
  • asking for removal of the deprecation notices (why? so you can delay your pain until upgrading, when you'll ask for re-instatement of the feature?); or
  • asking for a justification of the change.

So, I've decided to do the last, justify the change, which addresses the reasons why we won't do the middle two, and addresses why the assumptions and assertions about ServiceLocatorAware's usefulness are mostly misguided.

From the blog

Posted 2015-05-15
Splitting the ZF2 Components

Today we accomplished one of the major goals towards Zend Framework 3: splitting the various components into their own repositories. This proved to be a huge challenge, due to the amount of history in our repository (the git repository has history going back to 2009, around the time ZF 1.8 was released!), and the goals we had for what component repositories should look like. This is the story of how we made it happen.

From the blog

Posted 2014-09-18
Deployment with Zend Server (Part 8 of 8)

This is the final in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed using the Zend Server SDK to deploy your Zend Server deployment packages (ZPKs) from the command line.

Today, I'll detail how I automate deployment with zf-deploy and zs-client (the Zend Server SDK), and wrap up the series with some closing thoughts.

From the blog

Posted 2014-09-16
Deployment with Zend Server (Part 7 of 8)

This is the seventh in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed setting up and clearing page caching.

Today, I'm sharing how to use the Zend Server SDK to deploy your Zend Server deployment packages (ZPKs) from the command line.

From the blog

Posted 2014-09-11
Deployment with Zend Server (Part 6 of 8)

This is the sixth in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed setting job script status codes.

Today, I'm sharing some tips around setting up page caching, and jobs for clearing the Zend Server page cache.

From the blog

Posted 2014-09-09
Deployment with Zend Server (Part 5 of 8)

This is the fifth in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed how to secure your Job Queue job scripts.

Today, I'm sharing some best practices around writing job scripts, particularly around how to indicate execution status.

From the blog

Posted 2014-09-04
Deployment with Zend Server (Part 4 of 8)

This is the fourth in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed a trick I learned about when to execute a chmod statement during deployment.

Today, I'm sharing a tip about securing your Job Queue job scripts.

From the blog

Posted 2014-09-02
Deployment with Zend Server (Part 3 of 8)

This is the third in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed creating recurring jobs via Zend Job Queue, à la cronjobs.

Today, I'm sharing a very short deployment script tip learned by experience.

From the blog

Posted 2014-08-28
Deployment with Zend Server (Part 2 of 8)

This is the second in a series of eight posts detailing tips on deploying to Zend Server. The previous post in the series detailed getting started with Zend Server on the AWS marketplace and using zf-deploy to create ZPK packages to deploy to Zend Server.

Today, I'm looking at how to created scheduled/recurring jobs using Zend Server's Job Queue; think of this as application-level cronjobs.

From the blog

Posted 2014-08-26
Deployment with Zend Server (Part 1 of 8)

I manage a number of websites running on Zend Server, Zend's PHP application platform. I've started accumulating a number of patterns and tricks that make the deployments more successful, and which also allow me to do more advanced things such as setting up recurring jobs for the application, clearing page caches, and more.

From the blog

Posted 2014-03-26
Apigility: Using RPC with HAL

A few days ago, we released our first beta of Apigility. We've started our documentation effort now, and one question has arisen a few times that I want to address: How can you use Hypermedia Application Language (HAL) in RPC services?

From the blog

Posted 2013-02-25
RESTful APIs with ZF2, Part 3

In my previous posts, I covered basics of JSON hypermedia APIs using Hypermedia Application Language (HAL), and methods for reporting errors, including API-Problem and vnd.error.

In this post, I'll be covering documenting your API — techniques you can use to indicate what HTTP operations are allowed, as well as convey the full documentation on what endpoints are available, what they accept, and what you can expect them to return.

While I will continue covering general aspects of RESTful APIs in this post, I will also finally introduce several ZF2-specific techniques.

From the blog

Posted 2013-02-13
RESTful APIs with ZF2, Part 2

In my last post, I covered some background on REST and the Richardson Maturity Model, and some emerging standards around hypermedia APIs in JSON; in particular, I outlined aspects of Hypermedia Application Language (HAL), and how it can be used to define a generic structure for JSON resources.

In this post, I cover an aspect of RESTful APIs that's often overlooked: reporting problems.

From the blog

Posted 2013-02-12
RESTful APIs with ZF2, Part 1

RESTful APIs have been an interest of mine for a couple of years, but due to circumstances, I've not had much chance to work with them in any meaningful fashion until recently.

Rob Allen and I proposed a workshop for PHP Benelux 2013 covering RESTful APIs with ZF2. When it was accepted, it gave me the perfect opportunity to dive in and start putting the various pieces together.

From the blog

Posted 2012-09-19
ZF2 Modules Quickstart (Screencast)

One of the exciting features of the newly released Zend Framework 2 is the new module system.

While ZF1 had modules, they were difficult to manage. All resources for all modules were initialized on each request, and bootstrapping modules was an onerous task. Due to the difficulties, modules were never truly "plug-and-play", and thus no ecosystem ever evolved for sharing modules.

In Zend Framework 2, we've architected the MVC from the ground up to make modular applications as easy as possible. Within ZF2, the MVC simply cares about events and services — and controllers are simply one kind of service. As such, modules are primarily about telling the MVC about services and wiring event listeners.

To give you an example, in this tutorial, I'll show you how to install the Zend Framework 2 skeleton application, and we'll then install a module and see how easy it is to add it to the application and then configure it.

From the blog

Posted 2012-08-17
On Microframeworks

A number of months ago, Ed Finkler started a discussion in the PHP community about "MicroPHP"; to summarize, the movement is about:

  • Building small, single-purpose libraries.
  • Using small things that work together to solve larger problems.

I think there are some really good ideas that have come out of this, and also a number of questionable practices1.

One piece in particular I've focussed on is the concept of so-called “microframeworks”.

From the blog

Posted 2012-07-30
ZF2's New Controller::init()

In Zend Framework 1, controller's had an init() method, which was called after the controller was instantiated. The reason for it was to encourage developers not to override the constructor, and thus potentially break some of the functionality (as a number of objects were injected via the constructor). init() was useful for doing additional object initialization.

class MyController extends Zend_Controller_Action
{
    public function init()
    {
        // do some stuff!
    }
}

But this feature is missing from ZF2; how can we accomplish this sort of pattern?

From the blog

Posted 2012-07-05
ZF2 Forms in Beta5

Forms are a nightmare for web development. They break the concept of separation of concerns:

  • They have a display aspect (the actual HTML form)
  • They have a validation aspect
  • And the two mix, as you need to display validation error messages.

On top of that, the submitted data is often directly related to your domain models, causing more issues:

  • Not all elements will have a 1:1 mapping to the domain model — buttons, CSRF protection, CAPTCHAs, etc. usually are application-level concerns, but not domain issues. Names valid for your domain model may not be valid names for HTML entities.

Add to this that the validation logic may be re-usable outside of a forms context, and you've got a rather complex problem.

From the blog

Posted 2012-04-30
Why Modules?

I've blogged about getting started with ZF2 modules, as well as about ZF2 modules you can already use. But after fielding some questions recently, I realized I should talk about why modules are important for the ZF2 ecosystem.

From the blog

Posted 2012-04-03
Developing A ZF2 Blog

This post tells a story.

A long time ago, I set out to write my own blog platform. Yes, WordPress is a fine blogging platform, as is Serendipity (aka "s9y", and my previous platform). And yes, I know about Habari. And, for those of you skimming ahead, yes, I'm quite aware of Jekyll, thank you anyways.

Why write something of my own? Well, of course, there's the fact that I'm a developer, and have control issues. Then there's also the fact that a blog is both a simple enough domain to allow easily experimenting with new technology and paradigms, while simultaneously providing a complex enough domain to expose non-trivial issues.

When I started this project, it was a technology-centered endeavor; I wanted to play with document databases such as CouchDB and MongoDB, and with caching technologies like memcached and redis.

Not long after I started, I also realized it was a great playground for me to prototype ideas for ZF2; in fact, the original DI and MVC prototypes lived as branches of my blog. (My repository is still named "zf2sandbox" to this day, though it technically houses just my site.)

Over time, I had a few realizations. First, my actual blog was suffering. I wasn't taking the time to perform security updates, nor even normal upgrades, and was so far behind as to make the process non-trivial, particularly as I had a custom theme, and because I was proxying to my blog via a ZF app in order to facilitate a cohesive site look-and-feel. I needed to either sink time into upgrading, or finish my blog.

My second realization, however, was the more important one: I wanted a platform where I could write how I want to write. I am a keyboard-centric developer and computer user, and while I love the web, I hate typing in its forms. Additionally, my posts often take longer than a typical browser session — which leaves me either losing my work in a GUI admin, or having to write first in my editor of choice, and then cut-and-paste it to the web forms. Finally, I want versions I can easily browse with standard diffing tools.

When it came down to it, my blog content is basically static. Occasionally, I'll update a post, but it's rare. Comments are really the only dynamic aspect of the blog… and what I had with s9y was not cutting it, as I was getting more spam than I could keep up with. New commenting platforms such as Livefyre and Disqus provide more features than most blogging platforms I know, and provide another side benefit: because they are javascript-based, you can simply drop in a small amount of markup into your post once — meaning your pages can be fully static!

Add these thoughts to the rise of static blogging platforms such as the aforementioned Jekyll, and I had a kernel of an idea: take the work I'd done already, and create a static blog generator.

From the blog

Posted 2012-03-05
View Layers, Database Abstraction, Configuration, Oh, My!

Late last week, the Zend Framework community released 2.0.0beta3, the latest iteration of the v2 framework. What have we been busy doing the last couple months? In a nutshell, getting dirty with view layers, database abstraction, and configuration.

From the blog

Posted 2012-02-08
ZF2 Modules You Can Use Today

One key new architectural feature of Zend Framework 2 is its new module infrastructure. The basic idea behind modules is to allow developers to both create and consume re-usable application functionality — anything from packaging common assets such as CSS and JavaScript to providing MVC application classes.

From the blog

Posted 2012-01-11
Why Conventions Matter

When I started teaching myself scripting languages, I started with Perl. One Perl motto is "TMTOWTDI" — "There's More Than One Way To Do It," and pronounced "tim-toady." The idea is that there's likely multiple ways to accomplish the very same thing, and the culture of the language encourages finding novel ways to do things.

I've seen this principle used everywhere and in just about every programming situation possible, applied to logical operations, naming conventions, formatting, and even project structure. Everyone has an opinion on these topics, and given free rein to implement as they see fit, it's rare that two developers will come up with the same conventions.

TMTOWTDI is an incredibly freeing and egalitarian principle.

Over the years, however, my love for TMTOWTDI has diminished some. Freeing as it is, is also a driving force behind having coding standards and conventions — because when everyone does it their own way, projects become quickly hard to maintain. Each person finds themselves reformatting code to their own standards, simply so they can read it and follow its flow.

Additionally, TMTOWTDI can actually be a foe of simple, elegant solutions.

Why do I claim this?

From the blog

Posted 2011-11-07
Getting started writing ZF2 modules

During ZendCon this year, we released 2.0.0beta1 of Zend Framework. The key story in the release is the creation of a new MVC layer, and to sweeten the story, the addition of a modular application architecture.

"Modular? What's that mean?" For ZF2, "modular" means that your application is built of one or more "modules". In a lexicon agreed upon during our IRC meetings, a module is a collection of code and other files that solves a specific atomic problem of the application or website.

As an example, consider a typical corporate website in a technical arena. You might have:

  • A home page
  • Product and other marketing pages
  • Some forums
  • A corporate blog
  • A knowledge base/FAQ area
  • Contact forms

These can be divided into discrete modules:

  • A "pages" modules for the home page, product, and marketing pages
  • A "forum" module
  • A "blog" module
  • An "faq" or "kb" module
  • A "contact" module

Furthermore, if these are developed well and discretely, they can be re-used between different applications!

So, let's dive into ZF2 modules!

From the blog

Posted 2011-09-12
Using the ZF2 EventManager

Earlier this year, I wrote about Aspects, Intercepting Filters, Signal Slots, and Events, in order to compare these similar approaches to handling both asychronous programming as well as handling cross-cutting application concerns in a cohesive way.

I took the research I did for that article, and applied it to what was then a "SignalSlot" implementation within Zend Framework 2, and refactored that work into a new "EventManager" component. This article is intended to get you up and running with it.

From the blog

Posted 2011-05-10
Backported ZF2 Autoloaders

In the past six weeks, I've delivered both a webinar and a tutorial on Zend Framework 2 development patterns. The first pattern I've explored is our new suite of autoloaders, which are aimed at both performance and rapid application development — the latter has always been true, as we've followed PEAR standards, but the former has been elusive within the 1.X series.

Interestingly, I've had quite some number of folks ask if they can use the new autoloaders in their Zend Framework 1 development. The short answer is "yes," assuming you're running PHP 5.3 already. If not, however, until today, the answer has been "no."

From the blog

Posted 2011-03-25
Code Generation with Zend\CodeGenerator

Zend Framework has offerred a code generation component since version 1.8, when we started shipping Zend_Tool. Zend_CodeGenerator largely mimics PHP's Reflection API, but does the opposite: it instead generates code.

Why might you want to generate code?

  • You can use it as an assistive form of "copy and paste" for common tasks (as an example, it's used in zf.sh to generate controller classes and action methods).
  • You might want to generate code from configuration, to remove the "compile" phase of generating objects from configuration values. This is often done to improve performance in situations that rely heavily on configurable values.

Zend\CodeGenerator in the ZF2 repository is largely ported from Zend Framework 1, but also includes some functionality surrounding namespace usage and imports. I used it this week when working on some prototypes, and found it useful enough that I want to share some of what I've learned.

From the blog

Posted 2011-03-04
How to Contribute to ZF2

ZF2 development is ramping up. We've been at it for some time now, but mostly taking care of infrastructure: converting to namespaces, re-working our exception strategy, improving our test suites, and improving our autoloading and plugin loading strategies to be more performant and flexible. Today, we're actively working on the MVC milestone, which we expect to be one of the last major pieces necessary for developers to start developing on top of ZF2.

A question I receive often is: "How can I contribute to ZF2?"

Consider this your guide.

From the blog

Posted 2011-01-10
Aspects, Filters, and Signals, Oh, My!

Last month, during PHP Advent, gwoo wrote an interesting post on Aspect-Oriented Design, or Aspect Oriented Programming (AOP) as it is more commonly known. The article got me to thinking, and revisiting what I know about AOP, Intercepting Filters, and Signal Slots -- in particular, what use cases I see for them, what the state of current PHP offerings are, and where the future may lie.

But first, some background is probably in order, as this is a jargon-heavy post.

From the blog

Posted 2010-12-22
Simple Interfaces and Micro MVCs

My job is great: I get to play with technology and code most days. My job is also hard: how does one balance both functionality and usability in programming interfaces?

I've been working, with Ralph Schindler, on a set of proposals around the Zend Framework 2.0 MVC layer, specifically the "C", or "Controller" portion of the triad. There are a ton of requirements we're trying to juggle, from making the code approachable to newcomers all the way to making the code as extensible as possible for the radical performance tuning developers out there.

From the blog

Posted 2010-11-09
Introducing the ZF2 Plugin Broker

In Zend Framework 2.0, we're refactoring in a number of areas in order to increase the consistency of the framework. One area we identified early is how plugins are loaded.

The word "plugins" in Zend Framework applies to a number of items:

  • Helpers (view helpers, action helpers)
  • Application resources
  • Filters and validators (particularly when applied to Zend_Filter_Input and Zend_Form)
  • Adapters

In practically every case, we use a "short name" to name the plugin, in order to allow loading it dynamically. This allows more concise code, as well as the ability to configure the code in order to allow specifying alternate implementations.

From the blog

Posted 2010-10-27
ZendCon 2010!

As I write this, ZendCon begins in less than a week. I have the honor and pleasure to be speaking there again, for the sixth year running.

ZendCon 2010

From the blog

Posted 2010-10-04
Using Action Helpers To Implement Re-Usable Widgets

I had a twitter/IRC exchange yesterday with Andries Seutens and Nick Belhomme regarding applications that include widgets within their layout. During the exchange, I told Andriess not to use the action() view helper, and both Andriess and Nick then asked how to implement widgets if they shouldn't use that helper. While I ended up having an IRC exchange with Nick to give him a general idea on how to accomplish the task, I decided a longer writeup was in order.

From the blog

Posted 2010-08-17
Autoloading Benchmarks

During the past week, I've been looking at different strategies for autoloading in Zend Framework. I've suspected for some time that our class loading strategy might be one source of performance degradation, and wanted to research some different approaches, and compare performance.

In this post, I'll outline the approaches I've tried, the benchmarking stategy I applied, and the results of benchmarking each approach.

From the blog

Posted 2010-07-01
Creating Zend_Tool Providers

When I was at Symfony Live this past February, I assisted Stefan Koopmanschap in a full-day workshop on integrating Zend Framework in Symfony applications. During that workshop, Stefan demonstrated creating Symfony "tasks". These are classes that tie in to the Symfony command-line tooling — basically allowing you to tie in to the CLI tool in order to create cronjobs, migration scripts, etc.

Of course, Zend Framework has an analogue to Symfony tasks in the Zend_Tool component's "providers". In this post, I'll demonstrate how you can create a simple provider that will return the most recent entry from an RSS or Atom feed.

From the blog

Posted 2010-06-04
State of Zend Framework 2.0

The past few months have kept myself and my team quite busy, as we've turned our attentions from maintenance of the Zend Framework 1.X series to Zend Framework 2.0. I've been fielding questions regularly about ZF2 lately, and felt it was time to talk about the roadmap for ZF2, what we've done so far, and how the community can help.

From the blog

Posted 2010-05-06
Writing Gearman Workers in PHP

I've been hearing about and reading about Gearman for a couple years now, but, due to the nature of my work, it's never really been something I needed to investigate; when you're writing backend code, scalability is something you leave to the end-users, right?

Wrong! But perhaps an explanation is in order.

From the blog

Posted 2010-04-19
PHP Invades Amsterdam; or, the Dutch PHP Conference

For the third year running, I'm pleased to be speaking at the Dutch PHP Conference, held again in Amsterdam this coming 10–12 of June.

From the blog

Posted 2010-04-06
A Primer for PHP 5.3's New Language Features

For the past month, I've been immersed in PHP 5.3 as I and my team have started work on Zend Framework 2.0. PHP 5.3 offers a slew of new language features, many of which were developed to assist framework and library developers. Most of the time, these features are straight-forward, and you can simply use them; in other cases, however, we've run into behaviors that were unexpected. This post will detail several of these, so you either don't run into the same issues — or can capitalize on some of our discoveries.

From the blog

Posted 2010-03-19
A Simple Resource Injector for ZF Action Controllers

Brandon Savage approached me with an interesting issue regarding ZF bootstrap resources, and accessing them in your action controllers. Basically, he'd like to see any resource initialized by the bootstrap immediately available as simply a public member of his action controller.

So, for instance, if you were using the "DB" resource in your application, your controller could access it via $this->db.

From the blog

Posted 2010-03-11
Module Bootstraps in Zend Framework: Do's and Don'ts

I see a number of questions regularly about module bootstraps in Zend Framework, and decided it was time to write a post about them finally.

In Zend Framework 1.8.0, we added Zend_Application, which is intended to (a) formalize the bootstrapping process, and (b) make it re-usable. One aspect of it was to allow bootstrapping of individual application modules — which are discrete collections of controllers, views, and models.

The most common question I get regarding module bootstraps is:

Why are all module bootstraps run on every request, and not just the one for the requested module?

To answer that question, first I need to provide some background.

From the blog

Posted 2010-03-04
Responding to Different Content Types in RESTful ZF Apps

In previous articles, I've explored building service endpoints and RESTful services with Zend Framework. With RPC-style services, you get to cheat: the protocol dictates the content type (XML-RPC uses XML, JSON-RPC uses JSON, SOAP uses XML, etc.). With REST, however, you have to make choices: what serialization format will you support?

Why not support multiple formats?

There's no reason you can't re-use your RESTful web service to support multiple formats. Zend Framework and PHP have plenty of tools to assist you in responding to different format requests, so don't limit yourself. With a small amount of work, you can make your controllers format agnostic, and ensure that you respond appropriately to different requests.

From the blog

Posted 2010-02-17
Symfony Live 2010

This week, I've been attending Symfony Live in Paris, speaking on integrating Zend Framework with Symfony. The experience has been quite rewarding, and certainly eye-opening for many.

To be honest, I was a little worried about the conference — many see Symfony and ZF as being in competition, and that there would be no cross-pollination. I'm hoping that between Fabien, Stefan, and myself, we helped dispel that myth this week.

From the blog

Posted 2010-02-04
Creating Re-Usable Zend_Application Resource Plugins

In my last article, I wrote about how to get started with Zend_Application, including some information about how to write resource methods, as well as listing available resource plugins. What happens when you need a re-usable resource for which there is no existing plugin shipped? Why, write your own, of course!

All plugins in Zend Framework follow a common pattern. Basically, you group plugins under a common directory, with a common class prefix, and then notify the pluggable class of their location.

For this post, let's consider that you may want a resource plugin to do the following:

  • Set the view doctype
  • Set the default page title and title separator

From the blog

Posted 2010-01-08
Quick Start to Zend_Application_Bootstrap

We added Zend_Application to Zend Framework starting in version 1.8.0. The intent behind the component was to formalize the application bootstrapping process, and provide a simplified, configuration-driven mechanism for it.

Zend_Application works in conjunction with Zend_Application_Bootstrap, which, as you might guess from its name, is what really does the bulk of the work for bootstrapping your application. It allows you to utilize plugin bootstrap resources, or define local bootstrap resources as class methods. The former allow for re-usability, and the latter for application-specific initialization and configuration.

Additionally, Zend_Application_Bootstrap provides for dependency tracking (i.e., if one resource depends on another, you can ensure that that other resource will be executed first), and acts as a repository for initialized resources. This means that once a resource has been bootstrapped, you can retrieve it later from the bootstrap itself.

From the blog

Posted 2009-12-10
Real-time ZF Monitoring via Zend Server

When keeping tabs on your ZF applications, it's often difficult to separate application errors from general PHP errors, and if you aggregate them in the same location as your web server errors, this can become more difficult still.

Additionally, PHP's error reporting doesn't provide a ton of context, even when reporting uncaught exceptions — typically you'll only get a cryptic exception message, and what file and line emitted it.

Zend Server's Monitor extension has some capabilities for providing more context, and does much of this by default: request and environment settings available when the error was logged, the function name and arguments provided, and a full backtrace are available for you to inspect. Additionally, the Monitor extension includes an API that allows you to trigger custom Monitor events, and you can provide additional context when doing so — such as passing objects or arrays that may help provide context when debugging.

From the blog

Posted 2009-11-09
Building RESTful Services with Zend Framework

As a followup to my previous post, I now turn to RESTful web services. I originally encountered the term when attending php|tropics in 2005, where George Schlossnaggle likened it to simple GET and POST requests. Since then, the architectural style — and developer understanding of the architectural style — has improved a bit, and a more solid definition can be made.

From the blog

Posted 2009-10-23
Exposing Service APIs via Zend Framework

The hubbub surrounding "Web 2.0" is around sharing data. In the early iterations, the focus was on "mashups" — consuming existing public APIs in order to mix and match data in unique ways. Now, more often than not, I'm hearing more about exposing services for others to consume. Zend Framework makes this latter trivially easy via its various server classes.

From the blog

Posted 2009-09-22
CodeWorks 2009 Begins

Today is the kickoff for CodeWorks 2009, a remarkable PHP road show hitting seven cities in 14 days. While I'm not joining the tour until Atlanta, I'm proud to be joining up at that stop and presenting a Zend Framework tutorial during the tour.

CodeWorks'09

From the blog

Posted 2009-08-31
Cloning the ZF SVN repository in Git

I've been using Git for around a year now. My interest in it originally was to act as a replacement for SVK, with which I'd had some bad experiences (when things go wrong with svk, they go very wrong). Why was I using a distributed version control system, though?

From the blog

Posted 2009-08-20
Blog Backlog

Several people have pointed out to me recently that I haven't blogged since early May, prior to attending php|tek. Since then, I've built up a huge backlog of blog entries, but had zero time to write any of them.

The backlog and lack of time has an easy explanation: my change of roles from Architect to Project Lead on the Zend Framework team. While the change is a welcome one, it's also been much more demanding on my time than I could have possibly envisioned. Out of the gate, I had to finish up the 1.8 release, and move immediately into planning and execution of the 1.9 release — while learning the ropes of my new position, and continuing some of my previous development duties. Add a couple of conferences (php|tek and DPC) into the mix, and you can begin to see the issues.

From the blog

Posted 2009-08-20
Autoloading Doctrine and Doctrine entities from Zend Framework

A number of people on the mailing list and twitter recently have asked how to autoload Doctrine using Zend Framework's autoloader, as well as how to autoload Doctrine models you've created. Having done a few projects using Doctrine recently, I can actually give an answer.

The short answer: just attach it to Zend_Loader_Autoloader.

Now for the details.

From the blog

Posted 2009-04-13
Creating composite elements

In my last post on decorators, I had an example that showed rendering a "date of birth" element:

<div class=\"element\">
    <?php echo $form->dateOfBirth->renderLabel() ?>
    <?php echo $this->formText('dateOfBirth[day]', '', array(
        'size' => 2, 'maxlength' => 2)) ?>
    /
    <?php echo $this->formText('dateOfBirth[month]', '', array(
        'size' => 2, 'maxlength' => 2)) ?>
    /
    <?php echo $this->formText('dateOfBirth[year]', '', array(
        'size' => 4, 'maxlength' => 4)) ?>
</div>

This has prompted some questions about how this element might be represented as a Zend_Form_Element, as well as how a decorator might be written to encapsulate this logic. Fortunately, I'd already planned to tackle those very subjects for this post!

From the blog

Posted 2009-04-10
Speaking at DPC (again!)

I'm thrilled to once again be speaking at the Dutch PHP Conference.

Like last year, I'm giving two sessions; unlike last year, these are going to be more advanced. I noticed last year both in terms of audience participation as well as in speaking with attendees that I'd be able to step it up a notch were I to return.

From the blog

Posted 2009-04-09
Rendering Zend_Form decorators individually

In the previous installment of this series on Zend_Form decorators, I looked at how you can combine decorators to create complex output. In that write-up, I noted that while you have a ton of flexibility with this approach, it also adds some complexity and overhead. In this article, I will show you how to render decorators individually in order to create custom markup for your form and/or individual elements.

From the blog

Posted 2009-04-07
Zend Framework 1.8 PREVIEW Release

By the time you read this, the Zend Framework team will have released a preview release of 1.8.0. While the final release is scheduled for later this month, this release represents the hard work of many contributors and shows off a variety of powerful new components.

If you're a Zend Framework user, you should give the preview release a spin, to see what it can do:

From the blog

Posted 2009-04-06
From the inside-out: How to layer decorators

This marks the second in an on-going series on Zend_Form decorators.

You may have noticed in the previous installment that the decorator's render() method takes a single argument, $content. This is expected to be a string. render() will then take this string and decide to either replace it, append to it, or prepend it. This allows you to have a chain of decorators — which allows you to create decorators that render only a subset of the element's metadata, and then layer these decorators to build the full markup for the element.

Let's look at how this works in practice.

From the blog

Posted 2009-04-03
The simplest Zend_Form decorator

I've been seeing ranting and general confusion about Zend_Form decorators (as well as the occasional praises), and thought I'd do a mini-series of blog posts showing how they work.

From the blog

Posted 2008-12-30
Model Infrastructure

In the last two entries in this series on models, I covered using forms as input filters and integrating ACLs into models. In this entry, I tackle some potential infrastructure for your models.

The Model is a complex subject. However, it is often boiled down to either a single model class or a full object relational mapping (ORM). I personally have never been much of a fan of ORMs as they tie models to the underlying database structure; I don't always use a database, nor do I want to rely on an ORM solution too heavily on the off-chance that I later need to refactor to use services or another type of persistence store. On the other hand, the model as a single class is typically too simplistic.

From the blog

Posted 2008-12-24
Applying ACLs to Models

In my last post, I discussed using Zend_Form as a combination input filter/value object within your models. In this post, I'll discuss using Access Control Lists (ACLs) as part of your modelling strategy.

ACLs are used to indicate who has access to do what on a given resource. In the paradigm I will put forward, your resource is your model, and the what are the various methods of the model. If you finesse a bit, you'll have "user" objects that act as your who.

Just like with forms, you want to put your ACLs as close to your domain logic as possible; in fact, ACLs are part of your domain.

From the blog

Posted 2008-12-22
Using Zend_Form in Your Models

A number of blog posts have sprung up lately in the Zend Framework community discussing the Model in the Model-View-Controller pattern. Zend Framework has never had a concrete Model class or interface; our stand has been that models are specific to the application, and only the developer can really know what would best suit it.

Many other frameworks tie the Model to data access — typically via the ActiveRecord pattern or a Table Data Gateway — which completely ignores the fact that this is tying the Model to the method by which it is persisted. What happens later if you start using memcached? or migrate to an SOA architecture? What if, from the very beginning, your data is coming from a web service? What if you do use a database, but your business logic relies on associations between tables?

While the aforementioned posts do an admirable job of discussing the various issues, they don't necessarily give any concrete approaches a developer can use when creating their models. As such, this will be the first in a series of posts aiming to provide some concrete patterns and techniques you can use when creating your models. The examples will primarily be drawing from Zend Framework components, but should apply equally well to a variety of other frameworks.

From the blog

Posted 2008-12-12
Autocompletion with Zend Framework and Dojo

I've fielded several questions about setting up an autocompleter with Zend Framework and Dojo, and decided it was time to create a HOWTO on the subject, particularly as there are some nuances you need to pay attention to.

From the blog

Posted 2008-12-02
Tidings of the Season

Just about every day, I have an idea for a blog post, and most days, by the end of the day, I just don't have the time or energy to actually write anything up. The inner writer in me screams, "no excuses!" while the aging adult in me whispers, "time for bed, dear."

So, to keep my hand in the game, here are a few things running through my head, or that I'm working on, or that I'll be doing soon.

From the blog

Posted 2008-11-17
Zend Framework 1.7.0 Released

Today, we released Zend Framework 1.7.0. This release features AMF support, JQuery support, and Twitter support, among numerous other offerings.

For this particular release, we tried very hard to leverage the community. The majority of new features present in 1.7.0 are from community proposals, or were primarily driven by community contributors. For me, this represents a milestone: ZF is now at a stage where fewer and fewer core components are necessary, and the community is able to build off it and add extra value to the project.

From the blog

Posted 2008-09-27
Pastebin app updates

I've been getting a lot of interest in my Pastebin demo app — partly by those wanting to play with Dojo+ZF, partly by those just interested in the application.

I'm constantly trying to improve the application. I've done one webinar and one UnCon session showcasing it, and will be presenting it at Dojo Develper Day in Boston this Monday as well as at php|works later this fall, and want to keep the materials up-to-date and freely available. To this end, I've created a Github repository so you can track the latest developments, as well as pull custom tarballs:

All patches and feedback are welcome!

From the blog

Posted 2008-09-25
ZendCon08 Wrapup

I'm a bit late on my ZendCon'08 wrapup; the conference left me both exhausted and with a backlog of email and work that has consumed me since it ended. However, this, too, is good, as it has given me time to reflect… and to finally get my slides up on SlideShare.

ZendCon was alternately exhausting, rewarding, educational, fruitful, infurating, and ultimately wonderful. I've been to every single ZendCon so far — I started at Zend a scant month before the inaugural event — and have spoken at each. My first time speaking was a fluke; David Sklar had just started at Ning and had to back out of his "Configuring PHP" tutorial session. Mike Naberezny and I were drafted to take it over, and we had N+1 attendees, where N was the number of speakers. Since that inauspicious beginning, I've gradually taken on more sessions and stuck around to participate in the conference more. I can honestly say that this was the biggest, busiest, and most community focussed ZendCon I can remember.

From the blog

Posted 2008-09-11
Setting up your Zend_Test test suites

Now that Zend_Test has shipped, developers are of course asking, "How do I setup my test suite?" Fortunately, after some discussion with my colleagues and a little experimenting on my one, I can answer that now.

From the blog

Posted 2008-09-09
Pastebin app and conference updates

I have a number of updates and followups, and decided to post them in a single entry.

First off, you may now view my Dojo Webinar online (requires login and registration at zend.com). Attendance was phenomenal, and I've had some really good feedback. If you want to see it live, I'm giving the talk (with revisions!) at the ZendCon UnConference, at Dojo Developer Day Boston later this month, and at php|works in November. I hope to be able to show new functionality at each presentation.

Second, I've completed what I'm calling version 1.0.0 of the pastebin application I demo'd in the webinar. The PHP code is fully unit tested (though I haven't yet delved into using DOH! to test the JS), and incorporates a number of best practices and tips that Pete Higgins from Dojo was kind enough to provide to me. When using a custom build (and I provide a profile for building one), it simply flies.

The pastebin application showcases a number of features besides Dojo: Zend_Test_PHPUnit was used to test the application, and Zend_Wildfire's FireBug logger and DB profiler are used to provide profiling and debug information.

Finally, ZendCon is next week! I'll be around, but already have a packed schedule (1 tutorial, 2 regular sessions, an UnCon session, a meet-the-developers session… and that's just what I know about!). I look forward to meeting ZF users and developers, though, so feel free to grab me and introduce yourself.

From the blog

Posted 2008-09-05
Proper Layer files when using Dojo with Zend Framework

During my Dojo and ZF webinar on Wednesday, Pete Higgins of Dojo fame noted that I could do something different and better on one of my slides.

This particular item had to do with how I was consuming custom Dojo build layers within my code. I contacted him afterwards to find out what he suggested, and did a little playing of my own, and discovered some more Dojo and javascript beauty in the process.

From the blog

Posted 2008-09-04
Speaking at php|works

I'm pleased to announce I've been selected to speak at php|works in Atlanta this November.

I'll be presenting my talk on Dojo and Zend Framework, demonstrating how to quickly and easily create rich and dynamic UIs using the various integration points with Dojo functionality provided by Zend Framework.

Looking forward to seeing you in Atlanta in November!

From the blog

Posted 2008-08-29
ZF+Dojo Webinar

I'm giving a webinar on Zend Framework and Dojo Integration this coming Wednesday, 3 Sept 2008.

I'm particularly excited about this webinar, as I've been developing a sample pastebin application to show off a number of features; the webinar will feature some screencasts showing the new code in action, and promises to be much more dynamic than my typical "bullet point and code" presentations.

I'm also going to show some techniques to use when developing with ZF+Dojo, including how to create custom builds once you're ready to deploy your application (and why you want to do so).

Register today!

From the blog

Posted 2008-08-28
Using dijit.Editor with Zend Framework

We're getting ready to release Zend Framework 1.6.0. However, one important Dijit had to be omitted from the release as I was not able to get it working in time: dijit.Editor.

This dijit is important as it provides an out-of-the-box WYSIWYG editor that you can use with your forms. Unfortunately, actually using it with forms is pretty tricky — Dojo actually ends up storing content outside the form, which means you need to create a handler that pulls the content into a hidden element when saving.

I have created an implementation, however, that you can start using now, and I'm posting it below. It includes both a view helper for displaying it, as well as a form element for use with Zend_Form.

From the blog

Posted 2008-08-27
Speaking at ZendCon 2008

I'll be speaking at ZendCon again this year, and have a four-course meal of sessions to deliver:

  • Best Practices of PHP Development: Mike Naberezny and I are teaming up for the fourth year running to deliver a tutorial session. While the session topic stays the same, he and I have each been developing a number of new practices over the past year that we look forward to presenting, including new work with PHPUnit for functional testing of your applications.

  • Getting Started with Zend Framework: This will build off our Quick Start, providing background on ZF as well as the basic tools and information needed to get your first ZF application up and running. I also hope to demonstrate how the current preview of Zend_Tool can simplify this dramatically.

  • Zend_Layout and Zend_Form: This session will show off features of Zend_Layout and Zend_Form. (Note: the subject matter may change.)

  • UnCon: Rich UIs and Easy XHR with Dojo and Zend Framework: For those unable to attend my webinar next week, or who simply want to see this in person, I'll be presenting my Dojo and Zend Framework talk during an UnCon session. I have developed a simple app to showcase various features of the Dojo/ZF integration, and to show how easy it is to quickly develop and then scale applications that have great, dynamic interfaces.

Looking forward to seeing you in California in September!

From the blog

Posted 2008-08-11
Zend Framework 1.6.0 Preview, or, PHP 4 is Dead

PHP 4 officially died Friday. I started programming PHP with release candidates of 4.0.0 — which simultaneously introduced me to the GNU C compiler and toolset. My first official job using PHP was at a shop that was using PHP 3, and considering the costs of upgrading to PHP 4 — which clearly offerred many benefits over its predecessor. I switched to PHP 5 as soon as the first official release was made four years ago — the pains of reference handling with objects, the introduction of a unified constructor, first-class support for overloading, and SimpleXML won me over immediately, and I've never looked back. Goodbye, PHP 4; long live PHP!

I'm celebrating with the second release candidate of Zend Framework 1.6.0, which should drop today. There are a ton of new features available that I'm really excited about. I'm not going to go into implementation details here, but instead catalogue some of the larger and more interesting changes that are part of the release.

From the blog

Posted 2008-06-30
Testing Zend Framework MVC Applications

Since I originally started hacking on the Zend Framework MVC in the fall of 2006, I've been touting the fact that you can test ZF MVC projects by utilizing the Request and Response objects; indeed, this is what I actually did to test the Front Controller and Dispatcher. However, until recently, there was never an easy way to do so in your userland projects; the default request and response objects make it difficult to easily and quickly setup tests, and the methods introduced into the front controller to make it testable are largely undocumented.

So, one of my ongoing projects the past few months has been to create an infrastructure for functional testing of ZF projects using PHPUnit. This past weekend, I made the final commits that make this functionality feature complete.

The new functionality provides several facets:

  • Stub test case classes for the HTTP versions of our Request and Response objects, containing methods for setting up the request environment (including setting GET, POST, and COOKIE parameters, HTTP request headers, etc).
  • Zend_Dom_Query, a class for using CSS selectors (and XPath) to query (X)HTML and XML documents.
  • PHPUnit constraints that consume Zend_Dom_Query and the Response object to make their comparisons.
  • A specialized PHPUnit test case that contains functionality for bootstrapping an MVC application, dispatching requests, and a variety of assertions that utilize the above constraints and objects.

From the blog

Posted 2008-06-30
Migrating OOP Libraries and Frameworks to PHP 5.3

With PHP 5.3 coming up on the horizon, I'm of course looking forward to using namespaces. Let's be honest, who wants to write the following line?

$viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');

when the more succinct:

$viewRenderer = HelperBroker::getStaticHelper('viewRenderer');

could be used? (Assuming you've executed 'use Zend::Controller::Action;' somewhere earlier…)

However, while namespaces will hopefully lead to more readable code, particularly code in libraries and frameworks, PHP developers will finally need to start thinking about sane standards for abstract classes and interfaces.

From the blog

Posted 2008-06-20
DPC08 Wrapup

Last Friday and Saturday I spent at the Dutch PHP Conference, hosted by Ibuildings. Unfortunately, I had very little time to blog while there. I'd prepared my outlines and basic slides before heading to the conference, but had a large number of screenshots and images to prepare that kept me up until the wee hours of the morning each day. In addition, the conference was extremely well organized — which meant that any time not spent speaking was spent interacting with attendees or other speakers — never a bad thing!

From the blog

Posted 2008-05-27
Zend Framework/Dojo Integration QA Slides

We had our Zend Framework/Dojo integration QA today. Aside from some connectivity issues at the beginning of the presentation, things went smoothly, and there were some good questions.

A number of people reported missing the slides or that the slides were not advancing. I'm posting them here; they will also be available on the Zend.com webinars page later this week.

ZendFramework_Dojo.ppt

Update: For those who want to view online, you can now do so at SlideShare.

From the blog

Posted 2008-05-22
ZF Subversion Reorganization

If you've found that your SVN checkouts or svn:externals of Zend Framework are not working currently, then you missed the announcements on fw-general and #zftalk; I've just completed a Subversion Reorganization that is part of our new proposal process and 'Extras' offering. Please follow the link for details on how to update your installs.

From the blog

Posted 2008-05-21
Zend Framework Dojo Integration

I'm pleased to announce that Zend Framework will be partnering with Dojo Toolkit to deliver out-of-the-box Ajax and rich user interfaces for sites developed in Zend Framework.

First off, for those ZF users who are using other Javascript toolkits: Zend Framework will continue to be basically JS toolkit agnostic. You will still be able to use whatever toolkit you want with ZF applications. ZF will simply be shipping Dojo so that users have a toolkit by default. Several points of integration have been defined, and my hope is that these can be used as a blueprint for community contributions relating to other javascript frameworks. In the meantime, developers choosing to use Dojo will have a rich set of components and integration points to work with.

The integration points we have defined for our initial release are as follows:

From the blog

Posted 2008-05-18
Speaking at the Dutch PHP Conference

I've known for some time, but was reluctant to blog about it until the plane tickets were purchased and in hand: I've been invited to speak at the Dutch PHP Conference this coming June:

DPC

I'll be presenting two separate sessions: an all day tutorial on 13 June 2008 covering Zend Framework, and a regular session on 14 June 2008 covering Best Practices for PHP development, which will focus on how to utilize Zend Framework coding standards and methodologies to help deliver efficient, high quality code for your organization.

I'm looking forward to meeting old and new friends alike at the conference!

From the blog

Posted 2008-05-05
Form Decorators Tutorial posted

As a continuing part of my MVC series, I've posted a new article on Form Decorators up on the DevZone.

I'm hoping this will be the definitive guide to using form decorators. I cover the design decisions behind them, basics of operation, how to customize output by mixing and matching standard decorators, and how to create your own custom decorators. Among the examples are how to create a table-based layout for your forms (instead of the dynamic list layout used by default), and how to use a View Script as your form decorator in order to have full control over your form layout.

So, if you've been playing with Zend_Form and having trouble wrapping your head around decorators, give it a read!

From the blog

Posted 2008-04-28
Zend Framework Q&A Session

With 1.0 and 1.5 of Zend Framework now released, there are a lot of questions flying around -- what will we do next, what components to expect, what are some of the best practices, etc. So, we're going to have an open Question and Answer Session webinar, with all of us on the internal team.

If you have a question you want answered, please be kind enough to submit your question in advance, so we have time to actually think about it (though you can always broadside us during the webinar).

Sign up in advance so you don't miss out!

From the blog

Posted 2008-04-28
View Helpers Tutorial on DevZone

I have another tutorial in my Zend Framework MVC series up on DevZone today, this time on View Helpers. If you're curious on how to create view helpers, override the standard view helpers, or how some of the standard view helpers such as partials and placeholders work, give it a read!

From the blog

Posted 2008-04-14
ZF Plugins Tutorial on DevZone

I'm doing a series of articles on various Zend Framework MVC topics for the Zend Developer Zone. Last week, I covered Action Helpers. This week, I cover Front Controller Plugins. If you've ever been mystified by or curious about this subject, head on over and give it a read!

From the blog

Posted 2008-04-07
Action Helpers in ZF

I've posted a new article on Action Helpers in Zend Framework's MVC on the Zend Developer Zone. If you've ever wanted more information on these, follow the link.

From the blog

Posted 2008-04-03
Zend Framework 1.5 Podcast

Cal has released a new PHP Abstract podcast today on the Zend Developer Zone, an interview with Wil Sinclair, the project manager for Zend Framework, and Brad Cottel, Zend's product Evangelist. In it, they talk quite a bit about the work I've done on Zend Form, and also a lot about the proposal process.

If you're interested in the new 1.5 features, or how the proposal process works and who contributes to the community, give it a listen!

From the blog

Posted 2008-03-28
Dojo 1.1.0 Released

Dojo announced today the availability of 1.1.0.

I've been toying with Dojo off-and-on for almost a year now. It's the most framework-y of the various JS toolkits I've tried, and I particularly appreciate its modularity. (That said, it can lead to a lot of HTTP requests to your site if you don't create a targetted bundle with the modules you need.)

The 1.1.0 release has me pretty excited, as it finally is doing something most other JS frameworks have been doing for some time: its XHR requests now send the X-Requested-With: XMLHttpRequest header, which allows it to conform to the isXmlHttpRequest() method in Zend Framework's request object. This makes it much easier to provide a standard mechanism in your server-side code for detecting AJAX requests, allowing context switching to be automated.

From the blog

Posted 2008-03-28
Login and Authentication with Zend Framework

Update: this article is now available in French, courtesy of Frédéric Blanc.

I've fielded a number of questions from people wanting to know how to handle authentication and identity persistence in Zend Framework. The typical issue is that they're unsure how to combine:

  • An authentication adapter
  • A login form
  • A controller for login/logout actions
  • Checking for an authenticated user in subsequent requests

It's not terribly difficult, but it does require knowing how the various pieces of the MVC fit together, and how to use Zend_Auth. Let's take a look.

From the blog

Posted 2008-03-18
Using Zend_View Placeholders to Your Advantage

Somebody asked for some examples of how I use the headLink(), headScript(), and other placeholder helpers, so I thought I'd take a crack at that today.

First off, let's look at what these helpers do. Each are concrete instances of a placeholder. In Zend Framework, placeholders are used for a number of purposes:

  • Doctype awareness
  • Aggregation and formatting of aggregated content
  • Capturing content
  • Persistence of content between view scripts and layout scripts

Let's look at these in detail.

From the blog

Posted 2008-03-16
Zend Framework 1.5 is on its way!

As many know, Zend Framework 1.5.0 is almost ready for release… heck, it might even be released by the time you read this. There are a ton of new features worth looking into, but I'll list some of my own favorites here - the ones I've been either working on or using.

From the blog

Posted 2008-03-03
Zend_Form Webinar Wednesday

Just an FYI for anyone interested: I'll be performing a webinar for this week's Zend Wednesday Webinar series on Zend_Form. You can get details on the webinar and how to register for it at the Zend_Form webinar information page.

I'll be covering the design of Zend_Form, the basic usage and various classes and plugins available, and internationalization of your forms. Please join me Wednesday at noon EST!

From the blog

Posted 2008-02-08
Zend_Form Advanced Features

I've been working on Zend_Form for the past few weeks, and it's nearing release readiness. There are a number of features that Cal didn't cover in his DevZone coverage (in part because some of them weren't yet complete) that I'd like to showcase, including:

  • Internationalization
  • Element grouping for display and logistical purposes
  • Array support

This post will serve primarily as a high-level overview of some of these features; if you're looking for more in-depth coverage, please review the unit tests. :-)

From the blog

Posted 2008-02-07
Backwards Compatibility

Ivo already pointed this out, but I want to point it out again: Boy Baukema writes a very nice entry regarding backwards compatibility on the ibuildings.nl corporate blog.

Backwards compatibility (BC) is a tricky thing to support, even when you strive hard to, as Boy puts it, "think hard about your API" prior to release. Somebody will always come along and point out ways it could have been done better or ways it could be improved. I've had to wrestle with these issues a ton since joining the Zend Framework team, and while it often feels like the wrong thing to do to tell somebody, "too little, too late" when they have genuinely good feedback for you, its often in the best interest of the many users already using a component.

I had the pleasure of meeting Boy last year when visiting the ibuildings.nl offices, and he's got a good head on his shoulders. He does a nice job outlining the issues and a number of approaches to BC; if you develop a project for public consumption, you should definitely head over and read what he has to say.

From the blog

Posted 2008-01-30
Burlington PHP Tonight

The Burlington PHP User Group is having another meeting tonight at 5:30pm at Brown & Jenkins Coffee Roasters. From the announcement:

Bradley Holt will be giving a presentation on developing a web application using Zend Framework. Bradley Holt is founder and web developer for Found Line, a local design and development studio which has used Zend Framework in several recent projects. He also works as a software developer for a local non-profit. Before starting Found Line he worked as computer trainer teaching a variety of subjects including Java/JSP, ASP.NET, and PHP

Visit the meeting page for details on location and RSVPs. If you're in the Burlington, VT, area, we'd love to see you there!

From the blog

Posted 2008-01-01
2007 Retrospective

2007 was a busy year, both personally and professionally. I won't go into the personal too much, because, well, it's personal, and some of the details are simply inappropriate for blogging material.

Here's the short version:

  • One trip to Belgium and The Netherlands.
  • Two trips to Israel.
  • Two trips to Atlanta, GA (not counting the return trip from Europe, when I was stranded for a day due to storms in the Northeast).
  • Three different user groups attended, with three presentations.
  • One major Zend Framework release
  • One PEAR release.
  • One podcast.
  • One webinar.
  • One book published.
  • One conference attended.

What follows is my month-by-month breakdown:

From the blog

Posted 2007-12-19
Zend_Layout and Zend_View Enhanced components now in core

I'm pleased to announce that the Zend_View Enhanced and Zend_Layout components are now in the Zend Framework core. With these two components, you can now create some truly complex views for your application with relative ease.

The two components tackle several view related tasks:

  • Layouts, or Two Step Views
  • Partials (view fragment scripts with their own variable scope)
  • Placeholders (store data and/or markup for later retrieval)
  • Actions (dispatch a controller action)

From the blog

Posted 2007-12-02
Burlington PHP Users Group, December

I've been considering for a good six months trying to organize a PHP Users Group for the Burlington, VT, area. When we first moved to Vermont, I was surprised (and excited) by the number of PHP shops (which at the time I saw as job potential, as I was looking for work), and actually walked my resume around to a half-dozen or so. The area has a ton of PHP developers, and it only makes sense to have a UG where we can exchange tips and tricks of the trade.

Then, about six weeks ago, I mentioned this to my friend Rob. He did what I should have done all along, and googled for an existing group — and found one!

The Burlington, VT PHP Users Group has been around since November of 2005 on Google Groups, but we're having our inaugural meeting this coming Wednesday, 5 December 2007. I'll be speaking at this first meeting on Zend Framework's MVC components

If you're in the Burlington area this Wednesday, you should stop by. For more details, visit the event page, and don't forget to RSVP.

From the blog

Posted 2007-10-11
ZendCon is over at last

ZendCon '07 is finally over, the dust has settled, and I finally find myself with some time alone… practically the first I've had since Sunday. The week was fantastic, and I had many good conversations and brainstorming sessions. Oh, and I ended up giving three different sessions, so it's time for links to slides and materials:

  • Best Practices of PHP Development. Sebastian, Mike, and I presented a full-day tutorial on PHP development best practices, focussing primarily on testing and testing strategies, but also covering coding standards, usage of SCM tools, and deployment. There were a ton of questions from the attendees, and Sebastian even whipped out some extra slides at the end showing new and little-known features of PHPUnit. Basically, reading the slides won't really indicate what we covered, but is more of a general outline. It was an honor and pleasure to work with Sebastian and Mike on this, and I hope we can do it again in the future some time.
  • Zend Framework MVC Quick Start. This was basically the same session I did in my webinar a couple weeks ago, with a few corrections and a small demonstration. Cal put me on directly following Terry Chay, in the largest of the four session rooms — the one where all the keynotes occurred — talk about intimidating! Amazingly, the session was really well attended — others I talked to estimate between 100 and 150 people showed up. The most amazing part, though, was that when I asked how many people knew what 'MVC' was, I don't think there was a single person who didn't raise their hand — definitely a sign of how well accepted the pattern now is in PHP.
  • AJAX-Enabling Your Zend Framework Controllers. I did this talk for the Unconference, mainly because its a topic I've been interested in and wanted to present. In it, I detailed how to ajax-enable an application through some easy tricks with Action and View Helpers and using JS to decorate your existing application. The reference app I used was a pastebin, and I've got code for both Dojo and Prototype flavors available:

The two highlight keynote speakers, for me, were definitely Joel Spolsky and Cory Doctorow. Neither spoke about PHP, but both spoke about topics that PHP developers should take to heart. Perhaps I'll elaborate on those in another post.

Another bonus for me was the number of old and new friends alike I got to see — I had many good conversations with Paul M. Jones, Nate Abele, Ivo Jansch, and Ralph Schindler, and opportunities to finally meet fellow co-author Lig Turmelle, Ben Ramsey, Chris Shifflet (dude, we've been to four conferences together, and never yet met!), and many, many others. I was also overwhelmed by the number of Zend Framework users who sought me out either to ask me questions or simply thank me and the others on the team for the project; I'm deeply honored that I can work on a project that affects so many developers.

And now for some down time to recuperate…

From the blog

Posted 2007-10-02
oh, yeah, zendcon...

I don't know why I haven't blogged this sooner, but, yes, I'll be speaking once again at ZendCon:

I'll be presenting a number of times:

  • On Monday, I join Sebastian Bergmann and Mike Naberezny in a full-day tutorial session on PHP Development Best Practices and Unit Testing. This expands on what Mike and I did last year, and will more heavily emphasize the role of testing in the development process — arguably the most important best practice you can adopt.
  • On Tuesday monrning, I'll present a Zend Framework MVC Quick Start. This talk is based on a webinar I recently gave for Zend, and covers the various pieces of the MVC layer in Zend Framework.
  • Tuesday evening, I'll present an Unconference session on Ajax-enabling your Zend Framework controllers. I don't know yet if I'll need the whole hour, but I can probably fill it up with some examples of decorating your apps with AJAX.

Looking forward to seeing you all there!

From the blog

Posted 2007-09-26
Zend Framework MVC Webinar posted

Last Wednesday, I presented a webinar for Zend entitled "MVC applications with Zend Framework". We had more than 50 attendees, most of whom stayed on the whole time. For those of you who attended, thanks for the great questions and comments.

If you would like to view the webinar, download the slides, or download the example code (a hello world app), visit the Zend.com Webinar page and look for the presentation; as of today, it's the first one on the list, but that will change as more webinars are presented.

From the blog

Posted 2007-09-14
NYPHP Zend Framework Presentation

This past Wednesday, Zend's Chief Marketing Officer, Mark de Visser, and myself joined the NYPHP group for a special event meeting. Mark presented information on Zend's development stack and toolset (which I entirely missed, as I was still in transit), and I came in to give an overview of Zend Framework.

There were some great questions, and nice discussions following the event. If you live in New York and do PHP for a living, and haven't attended, you should; if you're ever visiting the area, see if you can attend a meeting!

Here are the slides. They're done using S5, a browser-based slideshow system. Simply unzip and double-click on index.html to start viewing.

Search tips

  • Use #{some tag} or tag:{some tag} to filter by tag; using this more than once will find results that match all tags.
  • Use year:{year} to filter by year. If you use this multiple times, the last one wins.
  • Use begin:{year-month-day} to restrict to results beginning on that day. Last one wins.
  • Use end:{year-month-day} to restrict to results ending on that day. Last one wins.