Skip to content

Instantly share code, notes, and snippets.

@gapple
Created December 5, 2012 18:38
Show Gist options
  • Save gapple/4218281 to your computer and use it in GitHub Desktop.
Save gapple/4218281 to your computer and use it in GitHub Desktop.
CakePHP 1.3 model ordering
<?php
class MyModel extends AppModel {
public function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
$this->order = array(
$this->alias . '.weight ASC',
$this->alias . '.name ASC',
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment