no longer findAll use find('all')
http://book.cakephp.org/view/449/find
- S2009/8/21 winegoddess <[email protected]> > > Hello, I am not sure why my messages are not getting through. > > I have a question regarding the IBM tutorial > > http://www.ibm.com/developerworks/opensource/tutorials/os-php-cake2/section2.html > > My knownusers page is not working. > I get a message that > The first argument should be an array [APP\views\users\knownusers.ctp, > line 3] > > I have several records in the users table. > > Here are my files: > > > VIEW (knownusers.ctp) > <table> > <?php echo $html->tableHeaders(array_keys($knownusers[0]['User'])); > foreach ($knownusers as $thisuser){ > echo $html->tableCells($thisuser['User']); > } > > ?> > </table> > > MODEL: > > <?php > class User extends AppModel > { > var $name = 'User'; > > var $validate = array( > 'first_name' => array( > > 'ruleName2' => array( > 'rule' => 'alphaNumeric', > 'required' => true, > 'message' => 'You must > enter a first name using letters only.' > ) > ), > > 'last_name' => array( > 'ruleName' => array( > 'rule' => '/^.{1,40}$/', > 'message' => 'Please enter > a first name between 1 and 40 > characters.' > ), > 'ruleName2' => array( > 'rule' => 'alphaNumeric', > 'required' => true, > 'message' => 'You must enter a > first name.' > ) > > ), > 'username' => array( > 'ruleName' => array( > 'rule' => '/^.{6,40}$/', > 'message' => 'Please enter > a username between 6 and 40 > characters.' > ), > 'ruleName2' => array( > 'rule' => 'isUnique', > 'message' => 'This username > has already been taken.' > ) > ), > > 'password' => array ( > 'rule' => '/^.{6,40}$/', > 'message' => 'Please enter > a password between 6 and 40 > characters.' > ), > 'email' => array('rule' => 'email', > 'message' => > 'Please enter a valid email address.' > ), > > ); > > > > } > ?> > > > CONTROLLER (truncated) > > <?php > class UsersController extends AppController > { > > var $name = 'Users'; > > > var $helpers = array('Html', 'Form' ); > > . > . > . > > > function knownusers() > { > $this->set('knownusers', $this->User->findAll(null, > array('id', 'username', 'first_name', 'last_name'), 'id > DESC') ) ; > } > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" 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 -~----------~----~----~----~------~----~------~--~---
