think PHP模板获取 request的方法
$Request.请求类型.请求参数如:$Request.get.status
php时间转时间戳,通用time = strtotime(data)
//ajax $.ajax({ type: 'POST', url: "{:url('admin/admin_del')}", data:{id:id}, dataType: 'text', success: function(data){ $(obj).parents("tr").remove(); layer.msg('已删除!',{icon:1,time:1000}); }, error:function(data) { console.log(data.msg); }, });
thinkphp的标签
//Volist标签主要用于在模板中循环输出数据集或者多维数组。 //{$key} --- 索引 {volist name="list" id="vo"}{ /volist} //switch标签
{ switch name="变量" } { case value="值1" break="0或1"}输出内容1{/case} { case value="值2"}输出内容2{/case} { default /}默认情况 {/switch} //if标签
{if isset($_GET['cate_id'])}
{if $vo.id == $_GET['cate_id']} class="active" {/if} {/if}
thinkphp模板的模糊查询
$where['name'] = ['like','%'.$name.'%'];
table
name="id" value="{ $order.id}"
javascript指令
window.location.reload(); //当前页面刷新
php的url生成
href="{:url('index/index',['cate_id'=>$vo.id])}">
效果为
http://127.0.0.1/bbs/public/index/index/index/cate_id/3.html
接收方法(后台模板均可接收。。。
if($id = input('param.cate_id')){} input('post.') --接收所有post数据的数组 )
//鼠标悬停在商品名,展露更多细节 $(".title").hover(function(obj) { var title = $(obj.target).text(); });
{$title|default="title"}