Cakephp Useful Tips

I was stumbling along today and found this great blog post on “Things You Must Know About CakePHP

There is a lot of great information in here, I especially liked the part on creating simple Admin Sections

Creating a simple admin center

If you need to create an administrative back-end for your CakePHP site and would like all the actions with administrative capabilities to exist under a specific folder, open up config/core.php and uncomment:
define(‘CAKE_ADMIN’, ‘admin’);
This will then make all actions that are prefixed with “admin_” to be accessible via:
/admin/yourcontroller/youraction. For instance, if I created an action in my posts controller called “admin_add,” I would access this via: www.example.com/admin/posts/add
From there I could simply password the admin folder to prohibit unwanted users from adding posts.

This is something that I am going to have to use in the current project that I am working on.

And knowing how to make custom 404 pages is really nice to know

Creating a custom 404 error page

If you need to change the page that users see when a document is not found, create:
/app/views/errors/error404.thtml

About Jeff
I am an engineer by day and internet marketing tinkerer at night. I started playing around with internet marketing 5 years ago and have been making a profit for the last 4, with no more than 4 hours a week on average and usually much less. The profit is not enough to quit the day job he loves, but enough to buy the toys he wants.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Speak Your Mind