一些东西,复制

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();
    });

 

 

<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>

    <title>{$title|default="title"}</title>
    <meta name="keywords" content="{$keywords|default="keywords"}" />
    <meta name="description" content="{$description|default="description"}" />

    
    <link rel="icon" href="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3694969640,119489513&fm=26&gp=0.jpg" type="image/x-icon" />
    <link rel="shortcut icon" href="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=3694969640,119489513&fm=26&gp=0.jpg" type="image/x-icon"/>
</head>
<body>
    
</body>
</html>

 

posted @ 2018-08-15 11:26  cl94  阅读(149)  评论(0编辑  收藏  举报