Re: Please help - 3rd time trying to post - Why is knownusers from IBM tutorial not working?

2009-08-23 Thread Dr. Loboto

There are a lot of chages between cake 1.1 and 1.2. IBM tutorials was
written for 1.1

On Aug 22, 11:34 pm, winegoddess  wrote:
> THANK YOU!!
>
> Im surprised I couldnt find anything correcting the tutorial on this.
>
> THANK YOU!!!
>
> Judy
>
> On Aug 21, 6:41 pm, Sam Sherlock  wrote:
>
>
>
> > no longer findAll use find('all')http://book.cakephp.org/view/449/find
> > - S
>
> > 2009/8/21 winegoddess 
>
> > > 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/s...
>
> > > 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)
> > > 
> > > tableHeaders(array_keys($knownusers[0]['User']));
> > > foreach ($knownusers as $thisuser){
> > >  echo $html->tableCells($thisuser['User']);
> > > }
>
> > > ?>
> > > 
>
> > > MODEL:
>
> > >  > > 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)
>
> > >  > > 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 cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please help - 3rd time trying to post - Why is knownusers from IBM tutorial not working?

2009-08-22 Thread winegoddess
THANK YOU!!

Im surprised I couldnt find anything correcting the tutorial on this.

THANK YOU!!!

Judy

On Aug 21, 6:41 pm, Sam Sherlock  wrote:
> no longer findAll use find('all')http://book.cakephp.org/view/449/find
> - S
>
> 2009/8/21 winegoddess 
>
>
>
> > 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/s...
>
> > 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)
> > 
> > tableHeaders(array_keys($knownusers[0]['User']));
> > foreach ($knownusers as $thisuser){
> >  echo $html->tableCells($thisuser['User']);
> > }
>
> > ?>
> > 
>
> > MODEL:
>
> >  > 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)
>
> >  > 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 cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Please help - 3rd time trying to post - Why is knownusers from IBM tutorial not working?

2009-08-21 Thread Sam Sherlock
no longer findAll use find('all')
http://book.cakephp.org/view/449/find
- S


2009/8/21 winegoddess 

>
> 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)
> 
> tableHeaders(array_keys($knownusers[0]['User']));
> foreach ($knownusers as $thisuser){
>  echo $html->tableCells($thisuser['User']);
> }
>
> ?>
> 
>
> MODEL:
>
>  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)
>
>  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 cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Please help - 3rd time trying to post - Why is knownusers from IBM tutorial not working?

2009-08-21 Thread winegoddess

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)

tableHeaders(array_keys($knownusers[0]['User']));
foreach ($knownusers as $thisuser){
 echo $html->tableCells($thisuser['User']);
}

?>


MODEL:

 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)

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---