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.
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.
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.
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
I had a problem with some urls including the paramaters from the url because i used the `Zend_View_Helper_Url`. So just a quicktip is, add the third param `$reset` which resets the url. So you would end up with something like this:
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.