• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

easyui支持php吗?

php 搞代码 4年前 (2022-01-04) 15次浏览 已收录 0个评论

easyui支持php吗?

easyui支持php,具体的使用方法是使用easyui来搭建页面结构,然后通过php返回的数据进行展示即可。

EasyUI是一组基于jQuery的UI插件集合体,EasyUI的目标就是帮助web开发者更轻松的打造出功能丰富并且美观的UI界面。开发者不需要编写复杂的javascript,也不需要对css样式有深入的了解,需要了解的只有一些简单的html标签。

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

1、首先编写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>

2、然后编写PHP文件

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

3、php返回数据示例:

{    "total": 2,    "rows": [{        "id": 1,        "user_id": <p style="color:transparent">来源gao!daima.com搞$代!码网</p>"1",        "time": "1",        "type": 1    }, {        "id": 2,        "user_id": "1",        "time": "1",        "type": 2    }]}

相关文章教程推荐:php教程

以上就是easyui支持php吗?的详细内容,更多请关注搞代码gaodaima其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:easyui支持php吗?

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址