Archive for the ‘CakePHP’ Category

My Development Environment.

Friday, November 21st, 2008

I spend most of my development time sat in Eclipse, I find it funny (or maybe slightly alarming) that only four moths ago I had never ventured near an Integrated Development Environment and spent a lot of time toiling away with a Crimson Editor.  All I can say is that ...

Validating Image Uploads in CakePHP

Monday, June 16th, 2008

Following on from my article on CakePHP - Uploaded File Validation in Models, today's snippet will show you how to use Cake's validation rules to reject invalid images, or images which do not conform to a specified mime-type. This code relies on the fact that you have LibGD installed ...

CakePHP – Activating User Account via Email

Tuesday, June 3rd, 2008

Continuing on from my User Registration with the AuthComponent post I'm going to cover how to activate user account's via email. Before we get down to the code lets look at a simple use case first. Activating User Accounts Via Email Use Case Goal: To confirm that users are registering with ...

CakePHP – Open_Basedir Restriction in Effect

Monday, June 2nd, 2008

Just deployed a CakePHP on a domain running PLESK and dismayed by the fact that your screen is over-flowing with warning about open_basedir restriction in effect? Fear not, the solution is straight forward (if a little frustrating to track down!) The problem is caused by this line (line 69, in ...

CakePHP – Uploaded File Validation in Models

Sunday, June 1st, 2008

Allowing uploaded files from users in PHP is fraught with danger, however by using CakePHP 1.2 and a little bit of Validation magic we can make things a little safer. First, lets start by creating a simple upload form where the users will be uploading their files Nothing particularly special here, just ...

CakePHP, Using CounterCache to keep track of Comments

Saturday, May 31st, 2008

CounterCache is one of the new Core Model Behaviors in CakePHP 1.2 and it's an absolute life saver for working with hasMany relationships where you want to OrderBy one of the children. The basic idea behind a CounterCache is to keep tabs on how 'children' a specific model has, this is ...

CakePHP Vimeo Helper

Monday, May 26th, 2008

I've just posted a new Helper over at the bakery to assist with embedding Vidoes from Vimeo.com on your CakePHP site. The helper grants you access to all configuration flags for the player. Grab it here, happy baking! As a side note, whilst fiddling around with this helper I ...

User Registration with CakePHP 1.2 and Auth Component

Saturday, May 24th, 2008

With CakePHP 1.2 nearly reaching the RC release, I have started using it as the framework for my own applications.  Once of the new features of 1.2 over 1.1 is the addition of numerous core Components for handling things such as Cookies, Email and Authentication (all of which I rolled ...