信息发布→ 登录 注册 退出

thinkphp redis用法是什么

发布时间:2019-08-26

点击量:

thinkphp redis用法是什么

thinkphp5如何使用redis?

1.设置应用配置文件config.php

q.jpg

type可以是很多分类File、Redis等等。

w.jpg

相关推荐:《ThinkPHP教程》

2.thinkphp5使用redis

新建application/index/controller/index.php

<?php namespace appindexcontroller;
use thinkController;
use thinkCache;
class Index extends Controller
{
    public function index()
    {    
        $han = new Cache;
        // halt($han);
        $han->set('name','klc123');
        $data = $han-&gt;get('name');
        $this-&gt;assign('data',$data);
        return view();
    }
}
标签:
在线客服
服务热线

服务热线

13331157271

微信咨询
二维码
返回顶部
×二维码

截屏,微信识别二维码

微信号:

(点击微信号复制,添加好友)

打开微信

微信号已复制,请打开微信添加咨询详情!