thinkphp模板传值

WBOY
Release: 2016-06-23 13:46:59
Original
1263 people have browsed it


这个是 站点设置的代码 public function site(){        $site = M("site");        $list = $site->select();        $this->assign("list",$list);        $this->display(); } public function update(){ $site   =   M("site");    if($site->create()) {        $result =   $site->save();        if($result) {            $this->success('操作成功!');        }else{            $this->error('写入错误!');        }    }else{        $this->error($Form->getError());    } } 这是邮箱设置的代码  这里开始出错了 不能使用同一个模板....... public function email(){        $site = M("email");        $email = $site->select();        $this->assign("email",$email);        $this->display(); } public function email_update(){ $email   =   M("email");    if($email->create()){        $result =   $email->save();        if($result) {            $this->success('操作成功!');        }else{            $this->error('写入错误!');        }    } }
Copy after login
Copy after login


回复讨论(解决方案)

display里面没写东西


这个是 站点设置的代码 public function site(){        $site = M("site");        $list = $site->select();        $this->assign("list",$list);        $this->display(); } public function update(){ $site   =   M("site");    if($site->create()) {        $result =   $site->save();        if($result) {            $this->success('操作成功!');        }else{            $this->error('写入错误!');        }    }else{        $this->error($Form->getError());    } } 这是邮箱设置的代码  这里开始出错了 不能使用同一个模板....... public function email(){        $site = M("email");        $email = $site->select();        $this->assign("email",$email);        $this->display(); } public function email_update(){ $email   =   M("email");    if($email->create()){        $result =   $email->save();        if($result) {            $this->success('操作成功!');        }else{            $this->error('写入错误!');        }    } }
Copy after login
Copy after login



       $this->display();  使用的模板是一个  也就是  一个html里面有三个form  但是 第一个form得到了 数据  剩下的2个得不到了....

你的模板代码贴出来看看,邮箱设置那段

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!