Browse Source

Merge branch 'master' of github.com:mevdschee/php-crud-api

Maurits van der Schee 5 years ago
parent
commit
b0132a387d
2 changed files with 48 additions and 2 deletions
  1. 3
    2
      README.md
  2. 45
    0
      examples/clients/datatables.html

+ 3
- 2
README.md View File

@@ -1090,10 +1090,11 @@ NB: Any non-error response will have status: 200 OK
1090 1090
 
1091 1091
 I am testing mainly on Ubuntu and I have the following test setups:
1092 1092
 
1093
-  - (Docker) Debian 10 with PHP 7.3, MariaDB 10.3, PostgreSQL 11.4 (PostGIS 2.5)
1094
-  - (Docker) Debian 9 with PHP 7.0, MariaDB 10.1, PostgreSQL 9.6 (PostGIS 2.3)
1095 1093
   - (Docker) Ubuntu 16.04 with PHP 7.0, MariaDB 10.0, PostgreSQL 9.5 (PostGIS 2.2) and SQL Server 2017
1094
+  - (Docker) Debian 9 with PHP 7.0, MariaDB 10.1, PostgreSQL 9.6 (PostGIS 2.3)
1096 1095
   - (Docker) Ubuntu 18.04 with PHP 7.2, MySQL 5.7, PostgreSQL 10.4 (PostGIS 2.4)
1096
+  - (Docker) Debian 10 with PHP 7.3, MariaDB 10.3, PostgreSQL 11.4 (PostGIS 2.5)
1097
+  - (Docker) Ubuntu 20.04 with PHP 7.3, MySQL 8.0, PostgreSQL 12 (PostGIS 3)
1097 1098
 
1098 1099
 This covers not all environments (yet), so please notify me of failing tests and report your environment. 
1099 1100
 I will try to cover most relevant setups in the "docker" folder of the project.

+ 45
- 0
examples/clients/datatables.html View File

@@ -0,0 +1,45 @@
1
+<html>
2
+<head>
3
+<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css"/>
4
+<script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.js"></script>
5
+<script type="text/javascript" src="https://cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js"></script>
6
+<script>
7
+$(document).ready(function() {
8
+    $('#example').DataTable( {
9
+        ajax: {
10
+            url: '/api.php/records/posts?join=categories&join=users',
11
+            dataSrc: 'records'
12
+        },
13
+        columns: [
14
+            { data: "id" },
15
+            { data: "user_id.username" },
16
+            { data: "category_id.name" },
17
+            { data: "content" }
18
+        ]
19
+    });
20
+});
21
+</script>
22
+</head>
23
+<body>
24
+
25
+<table id="example" class="display" style="width:100%">
26
+    <thead>
27
+        <tr>
28
+            <th>ID</th>
29
+            <th>Username</th>
30
+            <th>Category</th>
31
+            <th>Content</th>
32
+        </tr>
33
+    </thead>
34
+    <tfoot>
35
+        <tr>
36
+            <th>ID</th>
37
+            <th>Username</th>
38
+            <th>Category</th>
39
+            <th>Content</th>
40
+        </tr>
41
+    </tfoot>
42
+</table>
43
+
44
+</body>
45
+</html>

Loading…
Cancel
Save