Lately, I have been toying around with angularjs, and I have to confess, its quite a powerful framework. My side of the story.
Anyway, after reading much online here is my generic factory for consuming APIs(PHP SLIM 3).
This is how it is used.
In your controllers
I have not yet used PUT AND DELETE yet. Am quite uncomfortable with them
The rest api is like this, at the root of your site folder:
The get_table() is a little function I built to allow me to select tables in my simple database
If you do not understand, Please comment below and I will try help explain. Great week