public function view($id) {
$post = $this->Post->findById($id);
if (!$post) {
throw new NotFoundException('Could not find that post');
}
$this->set('post', $post);
}
header("HTTP/1.0 404 Not Found")
или для Fast-CGI header("Status:404 Not Found")