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

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

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: http://foo.com/contact

Posted in CakePHP

Quote of the day: Thay it Aint Tho!

why said on 21 Apr 2005 at 01:56 Lisp on Rails will be called Railth. from the comments Rails Clones: Bloodsuckers or Useful Drones?

Posted in CakePHP, Quote Of The Day, Web Development