0
点赞
收藏
分享

微信扫一扫

thinkphp3.2 缓存技术,保存网站数据,网站标题,提取和储存



首先把网站信息,储存到我们的服务器

thinkphp3.2 缓存技术,保存网站数据,网站标题,提取和储存_数据保存


  前端的ajax  post 数据过来就不多讲啦

public function add(){
if($_POST){
if(!$_POST['name']){
return show(0,'网站名称不能为空');
}
if(!$_POST['keywords']){
return show(0,'网站关键词不能为空');
}
if(!$_POST['description']){
return show(0,'网站的描述不能为空');
}
$id = D('Basic')->upsetbasic($_POST);
return show(1,'配置成功');
}else{
return show(0,'请提交数据');
}
}


在 controller  层,把提交的数据保存到服务器,  在这边用到了 大 D  的basic  的model  , 我们在model层用到了, thinkphp  自带的缓存的功能, 大F ,


public function upsetbasic($data=array()){
if(!$data){
throw_exception('没有相关数据');
}
$id = F('basic_config',$data);
return $id;
}


保存在了   basic-_config 里面了,   我们在哪边找到它?


thinkphp3.2 缓存技术,保存网站数据,网站标题,提取和储存_服务器_02

举报

相关推荐

0 条评论