説明なし

Index.php 365B

12345678910111213141516171819
  1. <?php
  2. namespace app\controller;
  3. use app\BaseController;
  4. use think\facade\Cache;
  5. class Index extends BaseController
  6. {
  7. public function index()
  8. {
  9. Cache::store('redis')->set("name","redis测试",3600);
  10. echo Cache::store('redis')->get("name");
  11. }
  12. public function hello($name = 'ThinkPHP6')
  13. {
  14. return 'hello,' . $name;
  15. }
  16. }