TP5数据写入缓存

public function index()
{

    if(Cache::get('category'))
    {
        $tree = Cache::get('category');
    } else{
        $tree = $this->getCate();
        Cache::set('category',$tree,3600*24);
    }

    $this->assign('tree',$tree);
    return view();
}

转载于:https://my.oschina.net/u/3483680/blog/1824049

你可能感兴趣的:(数据库,php,runtime)