KillerPHP Blog

PHP Frameworks


PEAR vs. Zend Framework

March 14, 2008

PEAR vs. Zend Framework

Now that the Zend Framework is ready for ‘prime time’, I’ve been considering the Pear framework with regards to how it now fits in the PHP world.

zend framework logo

NOTE:

Several picky nerds have pointed out that PEAR is not a framework – check out the comments below. OK, I would agree, technically speaking, PEAR is not a framework. That said, this is what the PEAR people say on the home page of their web site:

‘PEAR is a framework and distribution system for reusable PHP components. You can find help using PEAR packages in the online manual and the FAQ.’

Anyway, that is an argument of semantics and nerd-details … not the point of my article.

… Back to my article:


Both Zend and Pear are frameworks but how are they different?

I would say that the Zend Framework attempts to create a comprehensive whole – a consistent set of components that are designed to work together in a unified manner.

… That is one of the reasons for a framework in the first place.

Though unified, one of the cool things about the Zend Framework is that you can just pick and choose what components you want to use – you don’t have to buy the whole cake to take advantage of all that juicy object oriented PHP code.

About PEAR:
pear-framework-logo

With the Pear framework, it is more of a hodgepodge/motley of assorted components. Pear is widely used (and useful) but it does cross over (in terms of functionality) with what we have in the Zend Framework. So the question that comes to my mind is:

Do we still use Pear, if we have the Zend Framework?

(more…)

read more


Zend Framework Video Tutorials

March 9, 2008

zend framework logo

I just launched a new section on Killerphp.com on the Zend Framework.

I figured it only made sense, given that we’ve built two live web applications based on it:

Video sharing site: www.idea22.com
Web template sharing site: www.webshapes.org

For those of you who are not familar with the Zend Framework:

The Zend Framework is a web application framework designed to make building complex PHP based web applications easier.

The Zend Framework contains a series of components (built using PHP 5) that manages many common task in web application development:

* Zend_Form: to make form handling/processing easier.
* Zend_Mail: makes email functionality trivial to create in PHP.
* Zend_Db_Adapter: to connect to databases.
* Zend_Pdf: allows you to easily create and edit PDF documents.

… And this is just a small sampling.

There is a lot more in the works in terms of our videos and articles.

Thanks,

Stefan Mischook

www.killerphp.com
www.killersites.com

read more


Zend Framework: Using View Helpers to Build Rich, Scalable, Controls

January 29, 2008

Using View Helpers to Build Rich, Scalable, Controls
by: Jon Lebensold

Whether you’re developing an ASP.NET application, working with rails or dealing with a templating engine like Smarty, the idea of partial templates is not foreign. Partial templates allow developers and designers to work with panels or sub-groupings of content that need to be dynamic.

With a proper AJAX framework in place, these controls can be written in a way that they can be updated in whichever Controller they eventually reside. This kind of flexibility can allow you the flexibility of using certain signature controls for multiple parts of an application.

(more…)

read more


Zend Framework Components Part 2: Zend_View

January 14, 2008

By: Jon Lebensold

zend framework logo

As part of a series of articles about the Zend Framework and MVC, I’d like to take some time and cover Zend_View (the ‘V’ in that MVC triad).

Within the Zend Framework architecture and documentation, Zend_View is often coupled with the Zend_Controller as a means of providing a templating engine that encourages smart defaults over explicit programming.

For example, if I have a Controller named ‘AccountsController’ with an action (AKA a method that ends in ‘Action’ inside the AccountsController) called “new”, this would be mapped to the url “mydomain.com/Accounts/new”.

After running whatever is found inside AccountsConroller::newAction(), the Zend_Controller would be clever enough to dig out of my application/views/scripts folder, the Accounts/new.phtml file as a template for the action in question.

(more…)

read more


Zend Framework Components – Part 1

December 14, 2007

By: Jonathan Lebensold

Why aren’t you teaching me how to make a blogging / shopping cart application?

Because the Pragmatic Programmers did a fantastic job when they wrote their famous Rails book “Agile Web Development with Rails.” Crowds ooo-ed and aaa-ed when the rails camp wrote tutorials that described “how to make a blog in ten minutes using Rails.” PHPCake responded. They wrote a tutorial, and then people writing about Zend did the same thing.

When Stefan asked me to write about the Zend Framework, I decided I would avoid copy-able code, simply because it doesn’t re-enforce good software design. I’ve also read through many of these tutorials (most of which are excellent), however they tend to be misleading for several reasons:

– They don’t presume a complex view (with headers and footers that have dynamic logic)
– They don’t introduce core object libraries, but rather skim past them to get to the event-driven stuff (found in Zend_Controller, which I’ll cover soon)

(more…)

read more


The Zend Framework: Writing Object-Oriented PHP with Ease.

November 21, 2007

Introduction

In my attempt to turn you nerds into uber-nerds, I’ve been lucky enough to get the young and talented Jon Lebensold (my right hand nerd) to bang out a few articles (and soon videos) on some of the emerging PHP technologies and working practices that take PHP into the enterprise arena.

Enterprise arena = sophisticated scalable and adaptable code.

About this article:

The following article introduces you to ‘web application frameworks’. If you don’t know what this is, read on and you soon will. But for those of you that are impatient … in a nutshell:

A web application framework is a set of code libraries (in our case, that would be libraries written in PHP) that handles/does many of the things that we typically need to do when building database driven websites.

For more details, you need to read the article.

Stefan Mischook

The Zend Framework: Writing Object-Oriented PHP with Ease.

By: Jon Lebensold

This article aims to introduce the concept of developing a PHP application with a set of libraries that facilitate development by abstracting ones self from writing generic libraries.

We know that classes are composed of behaviours (methods) and data (properties), however their value only becomes apparent when we develop applications in layers, with different components answering different questions.

What Does a Layered Development Approach Look Like?

(more…)

read more