首页 > 代码库 > Thinkphp的S缓存用法!

Thinkphp的S缓存用法!

/节点列表    public function node(){                if(!$node = S(‘node_list‘)){            $field = array(‘id‘, ‘name‘, ‘title‘, ‘pid‘);            $node = M(‘node‘)->field($field)->order(‘sort‘)->select();            $node = node_merge($node);            S(‘node_list‘, $node, 3600);    //将节点列表缓存1小时        }        $this->node = $node;        $this->display();    }    

 

Thinkphp的S缓存用法!