Naneau

Go dik-dik, go!

Category: Zend Framework

Router abuse

Routing?
Today a post about Routing, that’s right, a real new post! How to use routes to get from a (nice looking) URL to modules/controllers/actions is something that has been explained in dept here and at other places. This post is not about that. This post is about how to use the router to reverse the [...]

Fun with the ViewRenderer

The ViewRenderer
Really, there is fun to be had! Since it’s introduction, the ViewRenderer had caused headaches and frustration. It is the one thing that glues the Controller and View parts of Zend’s MVC implementation together. As such, it ties in strongly with your code and is likely to cause confusion if you don’t know what [...]

Working on the wiki

Last night, SpotSec and I had the great idea of starting a little knowledge base for the Zend Framework. We have both noticed a number of frequent problems people (not just noobs) run into while trying to use the framework. While we intend to set up a proper knowledge base later (probably building some kind [...]

Use the URL view helper, please

When writing views, some time sooner or later, you’re going to be creating links to your own pages. Because you don’t want to end up writing relative URLs (they will not work, because the browser will add them to the current path), you need to have some kind of a base URL. A lot of [...]

Module-based error handling

Just a short post today. #zftalk is a good source of inspiration for me. Today Dan asked if it was possible to make the error handler use an ErrorController based on the module the error occurred in. There are some good reasons for why you would want this. For instance, your module may raise errors [...]

Timing your scripts

We all have to optimize, sometimes. Most people hate it, and for good reasons. There’s a real trade-off between code readability and clarity versus optimization. To get information on how your scripts are performing you’ll need to run software like xdebug. That works fine, especially during development.
But sometimes you just want some quick info on [...]

Lorem ipsum view helper

A while ago I wrote a little lorem ipsum class. I use it a lot when creating mock-ups. Having realistic filler text really helps with visualizing things.
When I wrote about view helpers the other day it dawned on me that I’ve never posted the view helper I created for use with the lorem ipsum class. [...]

Helpers and plugins

For people new to the Zend Framework the way it implements the model view controller (MVC) pattern may be a bit confusing. While the basic structure couldn’t be easier, it’s the details that cause problems. I’m going to have a go at trying to explain some of them here. I hope it helps. If [...]

View helpers

Another post on views today. But this will be a short one. See, I believe not enough focus is put on the usefulness of view helpers. When trying to separate design from logic, I believe that all things that can be removed from a view should be.
View helpers can come in quite nicely there. [...]

An object assigning action helper

I’m sorry for the cryptic title, but I’ll explain it. One of the major challenges in software design nowadays is portability. It’s one of the cornerstones of object oriented programming. The basic idea being that if you define a class that describes some kind of thing, in any other applications that work with the same [...]

Searching for a blog name

I’m writing a small weblog application, based on the Zend Framework. I’m trying to make it so that it’s usable both as a set of modules, and as a standalone application. While it probably won’t be a wordpress killer, I do want to make it powerful enough to run my own site.
It’s interface is going [...]

A simple JSON action helper

JSON is my language of choice for communication between JavaScript and server side scripts. It’s lightweight, and it can be interpreted natively in JavaScript. That means that it’s usually the fastest way of getting information from your server to the browser of your users.
The Zend Framework has an excellent utility for encoding things, called Zend_Json. [...]

On modules

Modules are a way of separating your software into re-usable blocks. For those new to the Zend Framework, it is often a source of confusion. I’m going to try to explain the philosophy behind them briefly, and give you a few tips on how to implement them.
The example given in the documentation is that of [...]

Using Naneau_View_Smarty with RC1

The new viewRenderer, introduced with the Zend Framework 1.0.0RC1 is a source of confusion for a lot of us. When I first upgraded I couldn’t figure out what on earth it was trying to do. Luckily, Matthew Weier O’Phinney has written an article over on devzone that explains the basics of it. I now understand [...]

MSN Messenger class

MSN Messenger is one of those things I wish I could abandon. But I can’t. In the Netherlands, it’s the number one instant messenger. And because I rather like the concept of having friends, I need to keep in touch with people. MSN Messenger is the way to go, unfortunately.
I like linux, I love gnome, [...]

Serving JavaScript and CSS

Now that JavaScript based sites are on the rise again, I have noticed that a lot of people serve their JavaScript and CSS uncompressed. With the discussion about all those nifty JavaScript libraries out there reaching an all time high, the fact that you can easily reduce file size by over two thirds should not [...]

The Zend Framework routing process

Because I noticed some people find it difficult to understand the routing process the Zend Framework uses by default, I decided to write a little explanation. It’s really easy once you get the hang of it, even though it may seem complicated at first.
The Zend Framework is based on the Model View Controller principle. This [...]

Smarty and the Zend Framework

Like I’ve mentioned in previous posts, I’m a great fan of using “decent” template engines, and try to avoid writing views in php. I don’t want to discuss the reasons behind this in detail right now. I just believe that limiting yourself to a small set of template tags makes you think more about structuring [...]

Setting up the Zend Framework

This article is very old. I’m keeping it here for legacy reasons, but if you’re looking for help setting up Zend Framework, google is your friend.

I would like to take some time to talk about setting up the Zend Framework. It’s a lot easier than you might think. I know there are quite a few [...]

Modified fields for Zend_Db_Table

Earlier today, I wrote a little extension to Zend_Db_Table that allows for “custom” fields to be added to it’s rows. When it was done some other ideas came floating up. Why wouldn’t I make my life even easier, by creating fields that don’t output their values directly, but in some meaningfully modified way.
Why would I [...]