easyui支持php吗?-PHP问题

资源魔 40 0

easyui支持php吗?

easyui支持php,详细的应用办法是应用easyui来搭建页面构造,而后经过php前往的数据进行展现便可。

EasyUI是一组基于jQuery的UI插件荟萃体,EasyUI的指标就是协助web开发者更轻松的打造出性能丰厚而且雅观的UI界面。开发者没有需求编写复杂的javascript,也没有需求对css款式有深化的理解,需求理解的只有一些简略的html标签。

上面是一个easyUI+PHP展现数据的例子,供列位参考:

一、起首编写HTML文件

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/color.css">
    <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/demo/demo.css">
    <script type="text/javascript" src="/mine/easyui/jquery.min.js"></script>
    <script type="text/javascript" src="/mine/easyui/jquery.easyui.min.js"></script>
</head>
<body>
<table id="dg" title="My Users" style="width:550px;height:250px"
       toolbar="#toolbar" idField="id"
       rownumbers="true" fitColumns="true" singleSelect="true"> 
    <thead>
    <tr>
        <th field="id" width="50" editor="{type:'validatebox',options:{required:true}}">ID</th>
        <th field="user_id" width="50" editor="{type:'validatebox',options:{required:true}}">UID</th>
        <th field="time" width="50" editor="text">TIME</th>
        <th field="type" width="50" editor="{type:'validatebox',options:{required:'true'}}">TYPE</th>
    </tr>
    </thead>
</table>
<script>
    $('#dg').datagrid({
        url: '/index/index/test2',
    });
</script>

</body>
</html>

二、而后编写PHP文件

<?php
$result = Db::table('o_attend')
            ->select();
$arr['total']=sizeof($result);
$arr['rows']=$result;
echo  json_encode($arr);
?>

三、php前往数据示例:

{
    "total": 2,
    "rows": [{
        "id": 1,
        "user_id": "1",
        "time": "1",
        "type": 1
    }, {
        "id": 2,
        "user_id": "1",
        "time": "1",
        "type": 2
    }]
}

相干文章教程保举:php教程

以上就是easyui支持php吗?的具体内容,更多请存眷资源魔其它相干文章!

标签: php php教程 php故障解决 php使用问题 easyui

抱歉,评论功能暂时关闭!