![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
yii2
文章平均质量分 95
熬夜的花斑狗
这个作者很懒,什么都没留下…
展开
-
Yii2 event-如何使用事件
这里说的是通过行为的方式绑定事件定义行为事件类:EventService.php<?phpnamespace api\components;use Yii;use yii\base\Behavior;use yii\base\Application;/** * 事件类 */class EventService extends Behavior{ // 定义事件名:Redis 服务检测 const EVENT_BEFORE_DEMO1 = 'beforeDe原创 2020-08-05 15:02:51 · 884 阅读 · 0 评论 -
Yii2 RESTful API 实现框架自带的 captcha 图形验证码
创建验证码生成类CodeImgGenerate.php<?phpnamespace common\helpers;use yii\captcha\CaptchaAction;class CodeImgGenerate extends CaptchaAction{ private $verifycode; public function __construct() { $this->init(); // 更多api请访原创 2020-08-03 16:54:05 · 980 阅读 · 0 评论 -
Yii2 FileHelper::findFiles() 返回在指定目录和子目录下找到的文件
注意Yii 提供许多类来简化常见编码,如对字条串或数组的操作, HTML 代码生成,等等。这些助手类被编写在命名空间yii\helpers下,并且 全是静态类 (就是说它们只包含静态属性和静态方法,而且不能实例化)。可以通过调用其中一个静态方法来使用助手类,如下:use yii\helpers\FileHelper;$files = FileHelper::findFiles('uploads',['only'=>['*.jpg']]);类说明Class yii...原创 2020-06-22 11:31:12 · 570 阅读 · 0 评论