当前位置:首页 > Web开发 > 正文

easyui撑持php吗?

2024-03-31 Web开发

easyui撑持php吗?

easyui撑持php,具体的使用要领是使用easyui来搭建页面布局,然后通过php返回的数据进行展示即可。

EasyUI是一组基于jQuery的UI插件调集体,EasyUI的方针就是辅佐web开发者更轻松的打造出成果丰富并且美不雅观的UI界面。开发者不需要编写庞大的javascript,,也不需要对css样式有深入的了解,需要了解的只有一些简单的html标签。

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

1、首先编写HTML文件

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

 

<!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>

 

2、然后编写PHP文件

1

2

3

4

5

6

7

 

<?php

$result = Db::table(‘o_attend‘)

            ->select();

$arr[‘total‘]=sizeof($result);

$arr[‘rows‘]=$result;

echo  json_encode($arr);

?>

 

3、php返回数据示例:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

 

{

    "total": 2,

    "rows": [{

        "id": 1,

        "user_id": "1",

        "time": "1",

        "type": 1

    }, {

        "id": 2,

        "user_id": "1",

        "time": "1",

        "type": 2

    }]

}

 

合肥代孕威信15023219993,太原代孕威信15023219993、上海代孕威信15023219993、广州代孕+15023219993、重庆代孕+15023219993以上就是easyui撑持php吗?的详细内容,更多请存眷php中文网其它相关文章!

easyui撑持php吗?

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/30318.html