Some Thoughts on MVC, Bad Design and Confusion

I was reading a post over here about why the ActionStack in Zend Framework is evil.  And I agree. I’ve used ActionStack before in a few older ZF sites (where better alternatives weren’t ready or I just didn’t know about them) but now as the framework has progressed there are many better alternatives to get […]

Zend Framework 1.7.5 Released

Zend Framework 1.7.5 was released just a short while ago.  While there’s not much with regards to features, there’s an interesting update to the view renderer and local file injection attacks. I’m guilty of using this style of inclusion in some cases.  Sometimes it’s just easier. I guess it’s time to re-think how I do […]

Why is XML Such a Pain in JavaScript?

Why is it that when one tries to parse some fairly simple xml: <placemarks> <placemark> <name>Placemark 1</name> <latitude>-79.00</latitude> <longiude>42.00</longitude> </placemark> <placemark> <name>Placemark 2</name> <latitude>-129.00</latitude> <longiude>43.00</longitude> </placemark> </placemarks> For example, iterating through all the placemarks and extracting the names, lats and longs using javascript is a very tedious affair. In fact, I’ve found it almost pointless […]

Zend Framework, FireBug, FirePHP and Debuggin’

I finally got around to implementing some debugging my applications. By debugging, I mean something more useful than random ‘echo’ and ‘exit’ statements littering my code. I found a nice post by Christoph Dorn with a few nice pointers on how to integrate FireBug and FirePHP using Zend_Log and Zend_Log_Writer_Firebug. My only addition was the […]

Geocodes Made Easy

Using my Google Maps API key I can geocode almost anything*. And with Zend Framework, it’s f’n damn simple! Zend_Loader::loadClass(‘Zend_Rest_Client’); $rest = new Zend_Rest_Client(‘http://maps.google.com/maps/geo’); //?q=1600+Amphitheatre+Parkway,+Mountain+View,+CA&output=json&oe=utf8&sensor=true_or_false&key=your_api_key $rest->key(‘YOUR_API_KEY’); $rest->q(‘1600 Amphitheatre Parkway, Mountain View, CA’); $rest->output(‘xml’); $rest->oe(‘utf8’); $result = $rest->get(); // the whole $result is a SimpleXML object print_r((string)$result->Response->Placemark->Point->coordinates); And that’s it.  Save the results someplace useful so […]