CakePHP HasAndBelongsToMany (HABTM) Checkboxes Instead of Multiple Select

Changing CakePHP’s default multiple select for HasAndBelongsToMany (HABTM) relationships to use multiple checkboxes used to be an arduous task. It is now a simple option as follows. If you have a Post model that has a HABTM relationship with a Tag model, you would use the following line to display multiple checkboxes instead of the… Continue reading CakePHP HasAndBelongsToMany (HABTM) Checkboxes Instead of Multiple Select

Published
Categorized as CakePHP

Akismet API Component for CakePHP 1.2

This is a component for CakePHP 1.2 and PHP 5+ that utilizes the Akismet API to fight comment SPAM. You will need an API key, which can be retrieved from wordpress.com. <?php/** * This is a component for CakePHP that utilizes the Akismet API *  * See http://akismet.com/development/api/ for more information. *  * Licensed under The MIT License *… Continue reading Akismet API Component for CakePHP 1.2

Published
Categorized as CakePHP

CakePHP Reverse Routing

CakePHP provides a very strong and flexible routing engine, for both routing, and reverse routing. Creating a route for the home page is as simple as adding the following line to your routes.php configuration file. Router::connect(‘/about_us’, array(‘controller’ => ‘pages’, ‘action’ => ‘display’, ‘about_us’)); Now, anyone visiting http://example.com/about_us page, will see the view defined in your… Continue reading CakePHP Reverse Routing

Published
Categorized as CakePHP

If You Want to Charge for a Service Online, Make Sure You Engage Your Customers

I recently switched my invoicing system from Simply Invoices to Fresh Books. Simply Invoices was great while I used it, but the complete lack of customer service forced me to switch. Admittedly, I was using their services for free, but I repeatedly requested/suggested new features that would not only benefit me, but all users, with… Continue reading If You Want to Charge for a Service Online, Make Sure You Engage Your Customers

Published
Categorized as General

Image Resizing Class

This is a simple script to resize images with PHP. It uses the GD Library functions, and is currently not compatible with ImageMagick. It will automatically determine the image type and use the appropriate functions to resize. <?php/** * This class handles image resizing. It will automatically determine the image * type and use the appropriate php… Continue reading Image Resizing Class

Published
Categorized as CakePHP