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…
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…
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…
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…
If you are working with multiple connections, you must specify the connection to mysql_insert_id(). Unlike other functions, it does not attempt to use the last opened connection, but instead fails returning false. Hopefully this helps someone else is as confused as I was last night.
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…
Over the past few years I have checked out many of the popular PHP frameworks out there. The three I did the most development with were CakePHP, CodeIgniter and Zend Framework. Each one has fills a very different set of needs, and I think most people do not understand that. People seem to take framework reviews very personally for some reason as if its a reflection of their ability.
Addressing Your Needs
To oversimplify things, it’s easy to map your role with some of the different frameworks. I choose these three, because they represent my point very well. I’m going to fudge the definitions a little bit here, and toss WordPress (or ‘insert your favorite CMS here’) into the mix as well. While the mapping may be an oversimplification, remember that the particular role’s core needs may match your needs for a project, even if you fit another role. Read more…
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…