getByPK($key); if($shortUrl->id) { $shortUrl->update(array('views' => intval($shortUrl->views + 1))); App::redirect($shortUrl->url); } else { App::error404(); } } }