The last posts in this series covered the a basic architecture of an API in cakePHP, the limitations of that basic architecture and a possible solution using an API component and some external API classes. The last part is the handling of API specific errors. The goals for the error handling system:
Rolling out an API for your cakePHP app Part ++1: The Solution
In the previous post I covered creating a basic API using cakePHP and what limitations are imposed if you want to extend the API over the course of several versions. This post is going to cover the architecture of a possible solution, I don't claim its the best solution out there and feedback is welcomed.
Rolling out an API for your cakePHP app Part 1: The Problems
Recently I've put a lot of work into an API solution for a cakePHP app which addresses some of the architectural issues of creating an API in a cakePHP project. To start with I threw together a nice simple API as a proof of concept and to showcase the ease at which an API can be created quickly using the RequestHandler component. While that solution was fine and incredibly quick to whip up, there are some issues when it comes time to extend the API, the biggest of which is versioning.
Rolling out an API for your cakePHP app Part 1: The Problems
Recently I've put a lot of work into an API solution for a cakePHP app which addresses some of the architectural issues of creating an API in a cakePHP project. To start with I threw together a nice simple API as a proof of concept and to showcase the ease at which an API can be created quickly using the RequestHandler component. While that solution was fine and incredibly quick to whip up, there are some issues when it comes time to extend the API, the biggest of which is versioning.
cakePHP saveall() and transactions, jQuery form plugin AJAX error handling
cakePHP, saveAll() and Transactions
MySQL transactions and cakePHP, the two play nicely together. Its very easy to wrap your inserts and updates in transactions with cake:
Multiple File Uploads CakePHP jQuery
Creating a basic form where you can add file inputs for file uploads dynamically using jQuery for the client side and cakePHP for the server side.
Translate a nested heirarchical array into another heirarchical array
Yes, that does sound like a pointless title. Let me explain the situation, we have a self referential model, Pages, which has child pages and a parent page. Because I'm using CakePHP for this project I have added the Tree Behaviour to the model also which is really handy, but you don't need that behaviour (mptt structure) in order for this to work.
CakePHP redirect to admin methods
If you have admin routing set: