ThinkPHP 模板中IF的使用
//根据不同的token显示不同的名称 Research_reedit.html
<if condition="$_REQUEST["token"] = "ybvvsv1433810135" ">头像:<else />LOGO:</if>
</pre><pre name="code" class="php">//编辑按钮 User/Excel_index.html
<a href="{Aimop::U("Research/saveInfo", array("rid" => $vo["id"], "token" => $token))}">修改</a>
//跳转的修改,需跳转到原来的列表,注意这里是模板ajax跳转 Research_reedit.html 161 行
<pre name="code" class="php"><if condition="$_REQUEST["token"] = "ybvvsv1433810135" "> location.href="{Aimop::U("Excel/index",array("token" => $token))}"; <else /> location.href="{Aimop::U("Research/index",array("token" => $token))}"; </if>
//判断三个问题是否都已经填写 2015-12-9 by zhyj $all_question=M("Research_question")->where(array("rid"=>$_POST["rid"]))->select(); foreach($all_question as $k=>$v){ //$all_q[]=$v["id"]; //dump($all_q); if ($_POST[$v["id"]]==""){ $this->error("所有问题必须填写"); }; } //判断结束
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。