Home  >  Article  >  Backend Development  >  thinkphp模板传值解决方案

thinkphp模板传值解决方案

WBOY
WBOYOriginal
2016-06-13 12:08:291316browse

thinkphp模板传值

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

------解决思路----------------------
display里面没写东西
------解决思路----------------------
你的模板代码贴出来看看,邮箱设置那段

Statement:
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