Data from outside SQL sent to client
Data from outside SQL sent to client
Hi,
is there a way to add data to the SSP file that does not come from the SQL tables but is created by PHP?
In my example, I'm displaying news items in the Editor table. In the SSP I'd like to add the amount of files in a certain folder (its name contains the SQL id) and show this number in the DataTable as additional column. This column, of course, can not be edited by the client.
My SSP at the moment looks like this:
$editor = Editor::inst(
$db, 'tablename',
'tablename.id' /* Primary Key */
)
->fields(
Field::inst('...all columns...'),
);
I have no clue how to 'sideload' additional PHP-generated data. Can you help me out? Thx
This question has an accepted answers - jump to answer
Answers
Hi,
Yes indeed - you want to use the
Editor->data()
method rather thanEditor->json()
.Basically all
Editor->json()
does is:So to modify the data Editor returns to the client-side you would do something like:
Allan
Dear Allan,
thanks a lot for this answer, that solved the problem.