Fatal error: Class'think\captcha' not found
Technical otaku
2021-12-23
Fatal error: Class'think\captcha' not found
The following is the controller code:
use think\captcha\Captcha;
class Index extends Admin
{
public function loginAction()
{
$captcha = new Captcha();
$a= $captcha->entry();
echo $a;exit;
Thinkphp root directory, right-click here to open the command line and execute the following command.
composer require topthink/think-captcha The
official version 5.0 extension library version number is 1.*, and the 2.0 version is dedicated to ThinkPHP5.1.
Simple usage of verification code
Some common usages are defined in the extension package for easy use. The following examples illustrate
Note: URL routing needs to be turned on.
Display of verification code in template
<div>{:captcha_img()}</div>
or
<div><img src="{:captcha_src()}" alt="captcha" /></div>
0 Comments