PHP objects

PHP objects

SandorSandor Posts: 1Questions: 1Answers: 0

I'm very new to the js, json and other webrelated languages. I have a ORM background, so when I picked the Datatables up, I would think there is a way to retrieve the data for the table out of my (PHP) class.
For every table in the database I have a class in my project, and via a static function RetrieveAll() I return an array of objects.
Is there a way to get this array 'into' the table??? I've been trying several examples, but can;t get it to work.
regards, Sandor

Answers

  • WoldereWoldere Posts: 17Questions: 3Answers: 2

    json_encode it and use ajax.

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    Yup - json_encode(). If you use that, what is the JSON structure returned? Use columns.data to tell DataTables which properties to read the values from for each column.

    Allan

This discussion has been closed.