How can we handle custom errors in cakePHP?, For instance, if end user modify URL directly,
eg: http://localhost/cake/topics/view/6
in case if this value not available, how can we handle this type of situation. Code
if (!$this->Topic->exists($id))
{
//$this->cakeError('fatal_error');
//$this->fatal_error('Invalid topic');
//throw new NotFoundException(__('Invalid topic'));
throw new NotFoundException(('Could not find that post'));
}
$options = array('conditions' => array('Topic.' . $this->Topic->primaryKey => $id));
$this->set('topic', $this->Topic->find('first', $options));
just write
throw new NotFoundException(('Could not find that post'));
it is not good it seems. so how can we handle it ?
please help me