29 lines
610 B
PHP
29 lines
610 B
PHP
|
<?php
|
||
|
|
||
|
/*
|
||
|
* Example PHP implementation used for the index.html example
|
||
|
*/
|
||
|
|
||
|
// DataTables PHP library
|
||
|
include("editor/lib/DataTables.php");
|
||
|
|
||
|
// Alias Editor classes so they are easy to use
|
||
|
use
|
||
|
DataTables\Editor,
|
||
|
DataTables\Editor\Field,
|
||
|
DataTables\Editor\Format,
|
||
|
DataTables\Editor\Mjoin,
|
||
|
DataTables\Editor\Options,
|
||
|
DataTables\Editor\Upload,
|
||
|
DataTables\Editor\Validate,
|
||
|
DataTables\Editor\ValidateOptions;
|
||
|
|
||
|
// Build our Editor instance and process the data coming from _POST
|
||
|
Editor::inst($db, 'roles')
|
||
|
->fields(
|
||
|
Field::inst('id'),
|
||
|
Field::inst('name'),
|
||
|
Field::inst('code')
|
||
|
)
|
||
|
->process($_POST)
|
||
|
->json();
|