CodeIgniter Forums
cant use json_encode to entity class - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: cant use json_encode to entity class (/thread-72610.html)



cant use json_encode to entity class - khusaeriz - 01-12-2019

i use json_encode an entity class but it's just return "{}".


RE: cant use json_encode to entity class - donpwinston - 01-12-2019

You got to turn your entity class object into an array to encode it.