thinkphp5如何使用redis?
1.设置应用配置文件config.php
type可以是很多分类File、Redis等等。
相关推荐:《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->get('name'); $this->assign('data',$data); return view(); } }