public function download($req, $res, $args) { $theme = ThemeModel::getData($args['name']); if (!$theme) { $notFoundHandler = Container::get('notFoundHandler'); return $notFoundHandler($req, $res); } $theme->nb_downloads = $theme->nb_downloads + 1; $theme->save(); $version = isset($args['version']) ? $args['version'] : 'master'; return Router::redirect('https://api.github.com/repos/featherbb/' . $theme->vendor_name . '/zipball/' . $version); }