Archive for category How-To
Inject Dojo Bookmark
Sometimes it can be handy to inject Dojo into pages that would not otherwise have it. I’ve used this so I can use dojo.query() on a page to select DOM objects while testing a parser in a different language.
Use drag this link into your bookmarks and have Dojo at your fingertips no matter where your browser takes you:
Inject Dojo v.1.3.2
Zend Framework Doctrine Model Autoloader
There have been several tutorials outlining how to autoload Doctrine Models using the Zend_Loader_Autoloader. However, none of these have permitted Zend / PEAR style naming conventions for models. I prefer to use these conventions because, although it makes my model names longer, the “name-spacing” gives a certain degree of organization and order to the application.
Read the rest of this entry »
Building a PHP Publish / Subscribe System
First post in a while. I have been busy working on some large application and finishing up my Computing Science Degree. Now that the piece of paper is safely secured above my fireplace, I’ve been trying to find time to do a new post.
I have been building a large application and one of the requirements is to trigger a certain action when an event happens. For example, trigger the sending of an alert email when a database row is updated. Some programmers may be tempted to simply hard-code this functionality into the model class, however this doesn’t give very strict class encapsulation, and can quickly become un-maintainable.
I use the Dojo Javscript toolkit for most of my dynamic front-end functionality. It has implemented a publish/subscribe system using dojo.publish() and dojo.subscribe(). This article will describe the implementation of a similar system using PHP. Read the rest of this entry »
Per Module Zend_Layout
Sometimes when you are building a web application, you want to use different layouts for different parts of the site. For example, in a content management system, you may want one layout for normal users and another, completely different layout for site administrators. Read the rest of this entry »
Cache-Control with Zend Framework
Today I was optimizing a site that uses heavy PHP and Ajax. I wanted to reduce the amount of data that was being sent from the server. To put this in perspective, if there were no cache hits in a page load there would be a total of 755 KB pulled down over 123 requests.
Read the rest of this entry »