Design Patterns in PHP

The Zend Developer Zone has an excellent series on how to follow design patterns when programming in PHP5.

It starts off with an introduction to the topic, and then presents three pattern until now, Observer, Composite and Visitor. Each article is split into two parts and goes step-by-step from theoretical background over class models to real PHP code.

Some interesting CSS links

Geoff Oliver has written a nice little example of how to create a tabbed navigation that allows dynamic addition of new tabs. Support for deleteing them is lacking, butI guess could be easily put in.

Nathan Smith coded a very light-weight (only 8k) roll-over image gallery with nothing more than CSS, called Hoverbox.

Do you know SkimCSS already? It is a digg-style community driven site, focused entirely CSS.

If you want to have pop up menus that work without JavaScript but CSS-only, Stef Ashwell’s tutorial might help you. To be fair, it uses a very small piece of JavaScript to fix a missing feature in IE.

A no-framework MVC approach in PHP

Rasmus Lerdorf, original creator of PHP and now working for Yahoo, does not like complex, feature-blown MVC frameworks fpr creating web applications. He has written a new Tutorial, creating a “no-framework PHP MVC framework” using only PHP5, JSON and the Yahoo! UI Library, suitable for creating the next fancy Web 2.0 site.

Many frameworks may look very appealing at first glance because they seem to reduce web application development to a couple of trivial steps leading to some code generation and often automatic schema detection, but these same shortcuts are likely to be your bottlenecks as well since they achieve this simplicity by sacrifizing flexibility and performance. Nothing is going to build your application for you, no matter what it promises. You are going to have to build it yourself. Instead of starting by fixing the mistakes in some foreign framework and refactoring all the things that don’t apply to your environment spend your time building a lean and reusable pattern that fits your requirements directly. In the end I think you will find that your homegrown small framework has saved you time and aggravation and you end up with a better product.

Rasmus provides a step-by-step tutorial from defining the goals of his project, explaining why and how to do the MVC method and showing the actual code, and also provides an example application.

(found in SitePoint’s PHP blog)