Hi everyone,
I'd like to know how to do CakePHP show an error when you try to
access a content that doesn't exists.
For example, with the next code, if I try to acces /group/view/3 and
doesn't exists the Group with id=3 in the database, it shows the
view.thtml with error from database.
class GruposController extends AppController
{
public function view($id=null){;
$data = $this->Grupo->findByUrl($id);
$this->set('data', $data);
}
}
How could I control this? For example show the error404 web or
redirect to other link
Thank you
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---