# think-captcha **Repository Path**: cosyphp/think-captcha ## Basic Information - **Project Name**: think-captcha - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-06 - **Last Updated**: 2026-01-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # think-captcha thinkphp6 验证码类库 ## 安装 > composer require topthink/think-captcha ## 使用 ### 在控制器中输出验证码 在控制器的操作方法中使用 ~~~ public function captcha($id = '') { return captcha($id); } ~~~ 然后注册对应的路由来输出验证码 ### 模板里输出验证码 首先要在你应用的路由定义文件中,注册一个验证码路由规则。 ~~~ \think\facade\Route::get('captcha/[:id]', "\\think\\captcha\\CaptchaController@index"); ~~~ 然后就可以在模板文件中使用 ~~~