Blog Archives

CakePHP: Subclassing Models

Spotted in the comments on the Bakery: App::Import (‘model’, ‘User’); class Seller extends User { var $name = ‘Seller’; } Thanks to Przemysław Sitek for this useful snippet! Advertisements

Tagged with:
Posted in CakePHP, Database, PHP

I tried realy hard to come up with a reason to post this. Oh look! PHP!

Posted in PHP

CakePHP Zebra Striped Tables

The following code sample will add an ‘altrow’ class to every alternative row in a table with a minumum overhead. The code produced is compatible with the default cake.generic.css stylesheet: <?php foreach ($upcoming_events as $i=>$event) { ?> <tr<?php echo ($i

Tagged with:
Posted in CakePHP, CSS, PHP

PHP Sessions fail in IE if there is an underscore in the domain name

This one is a new one on me ( and I got bitten with it today 😦 ) ********************WARNING*********************** There’s a bug in Internet explorer in which sessions do not work if the name of the server is not a

Tagged with:
Posted in PHP, Web Development

Quote of the day: Reputation…

If in doubt, soft-delete (active=0) – disc space is cheap, reputation is not. from the comments on The irony of Model::deleteAll()

Posted in CakePHP, Database, Quote Of The Day

links for 2007-10-02

Loud Baking » Blog Archive » ACL tables’ optimization for CakePHP 1.2.x.x How to tweak the index’s for the ACL tables to improve performance (tags: cakephp acl performance index)

Posted in CakePHP

CakePHP Tip: Routing for static pages

Woo, my first CakePHP Tip! Add the following to /app/config/routes.php: Router::connect(‘/contact’, array(‘controller’ => ‘pages’, ‘action’ => ‘display’, ‘contact’)); and create your contact page at: /app/views/pages/contact.ctp You can now access the contact page at:

Posted in CakePHP