// make the parameter required so requests without id will fail public function action_view($id) { // make sure $id is a valid positive number before attempting to fetch the post if ($id and ctype_digit($id) and $post = Model_Post::find($id)) { // process $post } else { // handle your not-found } }