Archive

Archive for the ‘Zend Framework’ Category

Inline Zend Form Hints

August 16th, 2010 Adrian 4 comments

One thing I always enjoy on sites is when they use the inline hints on text elements. Once you click on the element, the text disappears, and typically re-appears when it loses focus again, assuming it’s still empty. Semantically, these have quite a different meaning than what a description is, so it’s nice to also give users an example of the data, or an explanation of what you expect them to enter. This is a huge help when you require certain formats of data (URLs, emails, dates, etc.)

I’ve been messing around with my base Zend_Form class and came up with a solid implementation now. I’ve also expanded the concept to select elements, in which case it’d create a zero-value option with your hint. This entire inline hint concept is enabled by JavaScript (in this case, jQuery), so when JavaScript is not enabled, nothing different will happen for users. I think that’s ideal. Read more…

Zend Framework Models – Part 1: Concepts

February 22nd, 2010 Adrian 11 comments

The power in Zend Framework lies in its uncompromising flexibility. However, evidently, this also means its very difficult for new ZF users to pick up the framework and hit the ground running. The most common question I see is usually “where is the model?”. The goal of this post is to show some examples and hopefully some new ideas on how to tackle models. There is no one-size-fits-all solution folks. Let’s look at some options and some background… Read more…

Testing Zend_Mail

February 14th, 2010 Adrian 5 comments

Since I work on a local development machine/server, I’ve never taken the time to set up mail yet, nor do I want to. I think a staging environment is more appropriate to actually have email being sent out. Nevertheless, it has made testing any email functionality a little cumbersome. I’ve done a little research, and have found two ways to tackle the problem. I’ve also included code samples and other resources to get you started. Read more…

Caching Zend Framework Forms

February 10th, 2010 Adrian 4 comments

Generating a form is an expensive process in ZF. It’s always bugged me that I can’t find any resources on trying to cache the initial HTML anywhere, so I took a stab at it myself. I use a loader from inside my controller action to load forms and models, so I found that was a good place to start.

Here is my initial loader class, which I have stripped down and simplified for the sake of this example. Ideally, you’d want this in something like an action helper. Read more…

Forms in Zend Framework

February 9th, 2010 Adrian 10 comments

I’m often asked what my favorite component of Zend Framework is, and I invariably answer: “Forms”. Forms have always played an awkward role in the model-view-controller paradigm. Sure, the form is just HTML, but to me, it represents something more abstract than that. It represents the HTML form itself, taking user input, normalizing and validating it, and also being able to show the form again when errors occur. This can take quite a large amount of code. Read more…

Categories: Development, Zend Framework Tags: , ,

Installing Magento without Mcrypt

February 5th, 2010 Adrian 4 comments

Disclaimer: in a production environment, spend the extra time and resources to meet Magento’s requirements. This post is about setting up a development environment.

I have had one hell of a time trying to get Magento up and running on my development server. I have probably spent about 5 hours fighting with mcrypt and for some reason, it is just not playing nicely with my setup (PHP 5.3, with everything compiled manually). I brought in a server guru as well, and he had the same problem. I think we both tore out some hair.

I’ve hacked together some steps to get it up and running for developers who want to get their hands dirty quickly. Read more…