Trying to debug generator code: Editor::inst ... ->process($_POST)
Trying to debug generator code: Editor::inst ... ->process($_POST)
I am trying to understand (and debug) the code that is produced by the Editor generator. I created a simple test case for a table called "project". The editor instance sets the ajax property of the editor to /php/table.product.php:
$(document).ready(function() {
var editor = new $.fn.dataTable.Editor( {
ajax: 'php/table.project.php',
table: '#project', ...
I am trying to understand how the code in table.product.php works.
// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'project', 'projectId' )
->fields(
Field::inst( 'projectid' ),
Field::inst( 'name' ),
Field::inst( 'status' )
)
->process( $_POST )
->json();
Specifically, where will I find the code for the process function? I cannot find any mention of it from searching on the datatables site. Is there any documentation for it anywhere? I'm having trouble getting it to work in my case and I want to understand it.
Answers
The
process()method is in the PHP libraries for Editor. You can see the code for it here.What is the problem you are running into? Perhaps I can help point you in the right direction.
Allan