Tag Archives: zend framework

Instagram PHP Wrapper

So today I finished up my Instagram wrapper. Instagram has become very popular over the last year or so but it still doesnt have a proper api wrapper for php. So I made one of my own that fits right in to Zend Framework since thats my framework of choice. You can ofcourse use this with other frameworks or standalone. It depends on a few components off Zend Framework though.

See it here https://github.com/ranza/instagram

Adding prefix to tables with Zend_Db

I was working on my ZFPress project which is a clone of WordPress but in Zend Framework. And one of the features was to add a prefix to the tables. So i looked around but couldnt find any real solution to this. This is what i came up with.

What you would do is extending your tables with the abstract class and use them as you would normally. It’ll then automatically add your prefix from your app.ini if it exists.

Password confirmation using Zend Form and Validators

A while back i needed a password confirmation field for my users. I looked and found this neat little snippet. I cant remember who created it originally so i cant give credits to the person but its quite easy to use. Just add this to your library and create a new validator object like this.

This would be in your form where you want to have password confirmation.

On ZF’s Data Models

Michelangelo van Dam wrote a great post on Zend Frameworks data models. A lot of great pointers on how to create referencemaps between models without using any complex ORMs. The data mapper approach is a lot of work but it gives you a lot of great flexibility in the long run. Take a look at http://www.dragonbe.com/2010/01/zend-framework-data-models.html

Setup Zend_Rest_Route with multiple modules

Say you have an application and you want entire modules or just a controller to be treated and follow the RESTful ways you can do following in your bootstrap.php:

As you can see the 3th argument of `Zend_Rest_Route` will set “module”, or “module” => “controller”. Quite useful if you have an api module you want to treat as RESTful, or maybe a controller in a specific module used for some ajax stuff.