PHP

Zend Framework Autoload Classes

August 16, 2010
Thumbnail image for Zend Framework Autoload Classes

I wanted to add another library of classes to a Zend Framework project and autoload them, I created a folder called application/vendors/ to hold vendor libraries in seperate folders of their own. For example, using some CURL classes from Sem Labs, these classes would live in the application/vendors/semlabs/ folder.

Rolling out an API for your cakePHP app Part 3: Handling Errors

April 30, 2010
Thumbnail image for Rolling out an API for your cakePHP app Part 3: Handling Errors

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: Return specific error [...]

Rolling out an API for your cakePHP app Part ++1: The Solution

April 30, 2010
Thumbnail image for 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

April 29, 2010
Thumbnail image for 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 [...]

CakePHP session expire bug

April 8, 2010
Thumbnail image for CakePHP session expire bug

UPDATE: This bug has been fixed. This auth component / request handler component “bug” drops the 403 header code from an AJAX response when the session has timed out. Note: this is based on cakePHP version 1.2.4.8284 and may have been fixed already I haven’t checked.

CakePHP Paginate Multiple Data Sets on One Page

November 17, 2008
Thumbnail image for CakePHP Paginate Multiple Data Sets on One Page

Wanted: a simple method to paginate multiple sets of data separately on a single page using the cakePHP paginator helper/object. The problem with standard cakePHP pagination In this case I want to paginate the news items, but I have a flag in the news item table for is_archive, so basically want to seperate the current [...]

Multiple File Uploads CakePHP jQuery

September 14, 2008

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. First create the form with your form fields in it: < ?php echo $form->create(’NewsItem’, array(’type’ => ‘file’));   //Form for adding the plugin files echo $form->input(’PluginFile.1.description’); echo $form->input(’PluginFile.1.File’, array(’label’=>’File’, [...]

Translate a nested heirarchical array into another heirarchical array

August 17, 2008

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 [...]

Comparing web development frameworks by Opportunity

July 31, 2008

Graphs provided by IT Jobs Watch. Demand chart provides the 3-month moving totals beginning in 2004 of IT contractor jobs citing the web framework, within the UK as a proportion of the total demand within the Application Development category. Daily rate charts provide the 3-month moving average for daily rates quoted in IT contract jobs [...]

Validate Unicode/UTF-8 Form Input (Language Specific Characters)

March 9, 2008

Validating language specific characters in user input can be a bit of a pain, especially if you are using regular expressions to filter user submitted data. Not only that, but testing your methods can also be a pain – firstly you will need some shortcuts for entering UTF-8/Unicode chars into form inputs if you are [...]