Articles about CakePHP...
CakePHP Quick Tip: $html->clearCrumbs
Published on 16/10/08 | Comments (0)
Hi All
As part of an ongoing project, I was using the CakePHP's htmlHelper to generate breadcrumbs.
Now combined with the tree behavior's getpath function, the $html-addCrumb() and $html-getCrumbs() functions are great and a real time saver, but...
...for this particular page I actually want to show two or more different bread crumb trails, one for location, and one or more for categories, and that's where I hit a snag, as it stands the htmlhelper allows you to keep adding crumbs and displaying the trail so far, but
[more...]
CakePHP 1.2.0.7692 RC3
Published on 2/10/08 | Comments (0)
Hi all,
Just a quick post to help spread the word, cakePHP RC3 is finally here, and according to Nate's latest post at the bakery, this will be the final release candidate before they finalise the 1.2 version.
From reading through Nate's article, and the change set, It's clear that the team have worked tirelessly on iteration after iteration of performance improvements, to make the framework faster than ever before. By itself, the bootstrap process is over 10x faster than RC2, and basic requests for static content are now about
[more...]
Web Development Resources - Aptana Studio
Published on 11/9/08 | Comments (3)

At the risk of showing my age, it's been nearly 28 years since I wrote my first line of code. Way back in the heady days of ZX Basic on my trusty old ZX Spectrum. Back then to get anything usefull done it was Z80 assembly language or nothing.
Over the years I've used a lot of programming languages and a lot of IDE's, from Hisoft Basic on my Atari ST, through to Delphi and Visual Studio.
Nowadays, I tend to work extensively with both the .NET framework using Visual Studio 2008 and PHP using Aptana
[more...]
Quicktips: Finding all the actions in your controller
Published on 11/9/08 | Comments (0)
Hi All,
Thought I'd share a quick tip today for how to automatically detect all the action names within a given controller.
This follows on from my last quicktip, describing how to detect all the controllers in your application and is usefull from witin navigation code or admin back ends.
$actions = get_class_methods($this);
This returns an array where each element is the name of a method within the current controller.
Filtering your results
You can make this more usefull by filtering the
[more...]
CakePHP WhoIs Component
Published on 10/9/08 | Comments (0)
Here's one for all you aspiring web hosting ressellers out there, a fast and flexible whois class all wrapped up as a CakePHP component.
The component makes use of the excellent phpWhoIs class which you will need to download, unzip and place in APP/vendors/phpwhois in order for the component to work.
Click here to download phpWhoIs
phpWhoIs - a brief description
This package contains a Whois (RFC954) library for PHP. It allows
a PHP program to create a Whois object, and obtain the output of
a whois query with the Lookup
[more...]
Database switching in CakePHP
Published on 9/9/08 | Comments (0)
Thought I would share a quick tip today for managing database connections and debug information betwen your local development machine and production server.
Personally I tend to have a version running on my local development machine and on my web server and keep them in synch using the excellent Aptana Studio IDE and the following mean that I can do this without worrying about overwriting my database settings whenever I synchronise.
For starters replace the DATABASE_CONFIG class in APP/config/database.php with the code
[more...]
cakePHP Thumbnail Helper with GIF, PNG and JPG support
Published on 8/9/08 | Comments (2)
Hi all, a couple of weeks I got a request to add PNG and GIF support to my cakePHP thumbnail helper, so thought I'd post a quick updated version which includes this functionality.
Not a difficult one, I admit as the excellent phpThumb class library already includes this functionality, so just a matter of defining a default in the variable $extension, checking for an extension key in params, then setting it dynamically. In fact the only reason I didn't do this was because I didn't need it for the site
[more...]
CakePHP Thumbnail Helper
Published on 8/7/08 | Comments (5)
Today I've been working on generating thumbnails using the excellent phpThumb library, and integrating it into a CakePHP application I am writing.
In case you've not come across it before, phpThumb uses the GD library to create thumbnails from images (JPEG, PNG, GIF, BMP, etc) on the fly. The output size is configurable (can be larger or smaller than the source), and the source may be the entire image or only a portion of the original image. True color and resampling is used if GD v2.0+ is available, otherwise paletted-color
[more...]
CakePHP Containable Behavior
Published on 3/7/08 | Comments (2)
The last week or so, I have been taking a good look at the latest release of CakePHP.
CakePHP.1.2.0.7296 RC2 is a great release, so a big pat on the back to the entire development team, and keep up the good work.
One of my favourite features of the this release is the new Containable Behaviour which was introduced back in change set 6918 and is a mixture of two behavoirs, the original Containable behavior by Felix Geisendörfer and the Bindable behavior by Mariano Iglesias.
Basically the behavior allows find operations to
[more...]
PayPal IPN Controller for CakePHP
Published on 27/6/08 | Comments (2)
Thought I would share this handy little controller for processing PayPal IPN notifications within your cakePHP Apps.
For those new to PayPal integration, PayPal offers a system called IPN or Instant Payment Notifications whereby you can have a notification sent to your site each and every time a transaction takes place in your PayPal account.
The system is very flexible and allows you to send pass through buttons with your payment or subscription buttons that will come back in your IPN notifications so you can then
[more...]
Quicktips: Finding all the controllers in your cakePHP application
Published on 25/6/08 | Comments (0)
Hi Everyone,
Quick tip for all cakePHP developers today, have you ever wanted to obtain a list within your code, of all the controllers in your application?
CakePHP makes this pretty simple with the $configure class, just use:
$controllerList = Configure::listObjects('controller');
and by the magic of cake $controllerList will now contain an array of controllers you can iterate through.
Within my own code, I tend to use it quite frequently to build a basic admin menu, by iterating
[more...]
CakePHP Currency Conversion Component
Published on 23/6/08 | Comments (6)
Ever needed a reliable currency converter, that you can just drop into your application and never worry about manually updating the rates for.
Well I do for a current application I have been developing and I decided that it would make an ideal example for demonstrating how easy it is to create usefull CakePHP components.
So after a little Googling, I found that the Central European Bank, rather conveniently publishes an XML feed of rates against the Euro that is updated nightly, by using the HttpSocket class, the
[more...]
CakePHP Auth Component - Users, Groups & Permissions Revisited
Published on 20/6/08 | Comments (58)
In my earlier article CakePHP Auth Component - Users, Groups & Permissions I demonstrated step by step how to create a complete Authentication & Authorization system based around cakePHPs' Auth component.
Judging from the number of visits the article has had and the great comments I have received from the article, it prooved to be a bit of a winner, and as the last couple of weeks I haven't had a chance to post, due to sheer workload, I thought today, I would sit down and refactor the code to
[more...]
CakePHP Auth Component - Users, Groups & Permissions - Part II
Published on 2/6/08 | Comments (0)
In my first article in this series, I outlined a flexible and powerfull way of implementing a complete User Authentication and Authorization system, which:
- Is Permission based.
- Allows Users to HABTM Groups
- Allows Groups to HABTM Permissions
- Steers well clear of the complexities of the ACL component
- Makes full use of the built in AUTH component
In this article I am going to expand on the system and show how you can use the code to get a basic but flexible Admin menu with minimum effort.
Listing
[more...]
CakePHP Auth Component - Users, Groups & Permissions
Published on 20/5/08 | Comments (25)
UPDATE:
following on from the great response I have received to this article and numerous suggestions and requests left in the comments, I have now published an updated version of this article, which you can find here, the updated version contains all the code found here plus it has been refactored and improved to add features such as CakePHP 1.2.0.7125RC1 support, along with Permissions Caching and Controller Wide Permissions Wildcard support.
Ok, I've been using CakePHP for about three years now, and
[more...]
CakePHP 1.2 Stable
Published on 15/5/08 | Comments (0)
As a professional software developer, I have worked with numerous programming languages and more recently development frameworks, but a little over 2 years ago I discovered the CakePHP framework and I have been a keen convert ever since.
CakePHP is a modern, well structured framework for developing PHP applications in a fraction of the time it would normally take.
Much of the repetitive code used over and over again in many web applications is already implemented and because it is so widely used and has such a large community behind
[more...]
