I’ve been thinking a lot about Modeling in a MVC application, particularly in the Zend Framework. Obviously each application is different, and any Model is going to be fairly unique to your application. That’s why ZF doesn’t provide a base Model class. That said, there are some design patterns that a lot of people are using nowadays, and applications could use some base functionality to facilitate those patterns.
Zend Framework’s project lead, Matthew Weier O’Phinney, has a lot of great thoughts about Modeling that I’ve been trying to stick to. In implementing those ideas, I’ve started thinking out some base classes to build my Models on top of. Obviously these classes won’t work for everyone. But they should work for a lot of “typical” web applications.
A project I’m working on needs to output text that may have e-mail addresses in it to the Web. Because we don’t want people’s e-mail addresses exposed to spammers, I had to write an obfuscation class to make sure those e-mail addresses are hidden somehow. I haven’t decided what method to hide those addresses with yet (I’m leaning towards Mailhide), but I thought I’d post the base code now. The class is written so that you can extend it to hide the addresses however you like. Here’s the class (PHP 5 only, but would be easy to convert to PHP 4).
Continue reading “E-Mail Address Obfuscator Class” »
A couple of days ago Saul Rosenbaum asked for a little help with a PHP utility he was writing. I took a crack at it, and we ended up with a nice little class that generates CSS sprites from pairs of images. Saul wrote a great little README for it, but the general gist is that it takes a00.gif and a00_over.gif and creates a new a00.gif that has both images vertically stacked within it (it can do this with large batches of images).
We submitted the files to IndyHall Labs if anyone is interested in using them. If I have time I’ll be adding some new functionality (Saul added a wishlist in the README file, and I’d definitely love to tackle some of those issues).
You can download the files from GitHub: https://github.com/IndyHallLabs/css-sprite-generator/
Recent Comments