im using cake 1.1 and i saw this in the manual, is it not the same as
my code?
<?php
class UsersController extends AppController
{
function create()
{
// Check to see if form data has been submitted
if (!empty($this->data['User']))
{
//See if a user with that username exists
$user = $this->User->findByUsername($this->data['User']
['username']);
// Invalidate the field to trigger the HTML Helper's error
messages
if (!empty($user['User']['username']))
{
$this->User->invalidate('username');//populates
tagErrorMsg('User/username')
}
//Try to save as normal, shouldn't work if the field was
invalidated.
if($this->User->save($this->data))
{
$this->redirect('/users/index/saved');
}
else
{
$this->render();
}
}
}
}
?>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---