Just wanted to point out a few things I noticed:
- know your parameters: findAll($conditions=null, $fields=null,
$order=null, $limit=null, $page=1, $recursive=null)
- the conditions parameter for functions such as findAll is for, well,
conditions (the "where" clause in SQL)... not sorting. Use the $order
parameter for sorting.
- defining the var $conditions outside the function index definition
as a class property will require you to us it with this syntax: $this-
>conditions.
I guess this is what you were aiming for:
class ProgramsController extends AppController {
var $name = 'Programs';
var $sort = "p_date DESC, p_time ASC";
var $title_for_layout = 'Lake-Sumter Computer Society';
var $helpers = array('Html', 'Form' );
function index() {
$this->Program->recursive = 0;
$this->set('programs', $this->Program->findAll(null,
null, $this->sort));
}
This link should be helpful for you on seeing function parameters:
http://docs.cakephp.nu/classes/show/AppModel
Good luck! Cake rocks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---