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


CakePHP Currency Conversion Component

Published: on 23/6/08 | Comments (11)

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


CakePHP Auth Component - Users, Groups & Permissions Revisited

Published: on 20/6/08 | Comments (99)

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


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


CakePHP Auth Component - Users, Groups & Permissions

Published: on 20/5/08 | Comments (32)

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



About Studio Canaria

Studio Canaria is the web site of freelance web developer, Peter Butler. Articles on this site relate to designing, developing and marketing modern web applications.

Recent Comments

Dave on CakePHP Auth Component - Users, Groups & Permissions Revisited
I dont understand how you define permissions for each contoller to User. Do I have to manually...
SI on CakePHP Auth Component - Users, Groups & Permissions Revisited
Hi Peter,

I am having little issue logging into the application. I have 2 user groups both having...
Alig on CakePHP Auth Component - Users, Groups & Permissions Revisited
Thank you very much for this tutorial. After fighting for hours to get the cakephp ACL working,...
Benny on CakePHP Auth Component - Users, Groups & Permissions Revisited
thank you for your solution it's perfect , you are genius , thank you this is the best ( beside...
Gordon on CakePHP Auth Component - Users, Groups & Permissions Revisited
I'm having a similar problem to luis. I followed everything as instructed here up to the point...