Naneau

Go dik-dik, go!

Category: Web Development

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. [...]

Writing view scripts

A substantial part of my time I spend looking at other people’s code, for various reasons. Sometimes it’s just to figure out how others have solved a problem I am facing, and other times I’m trying to figure out why something doesn’t work. There has a growing focus on coding standards for a while now, [...]

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. [...]

Character lookup

As a web developer I find myself writing HTML a lot. And I’m sure that those of you who have spent more than 5 minutes doing the same thing, know the problem of entities. Because character encoding is still an issue, it’s often a good idea to write “weird” characters down using an ampersand and [...]

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 [...]

More art!

Well… Okay, its not more, it’s just better. I updated it. Which is what I do. I wrote the original script when I couldn’t sleep a few nights ago. Coding in a sleep-deprived state always gives me interesting results, although they may not always be that useful .
Today I took some time and had [...]

Prototype vs jQuery

One of prototype’s often overlooked functions is Element.addMethods(). Especially in these days of comparison between jQuery and Prototype, it’s important. The basic idea behind jQuery is that you can do a CSS selector query, and apply methods (even chaining them) to the result. Like:
12$(’#element’).after(’I get inserted after #element’);
//insert some html after an element
In prototype, you [...]