Reputation: 2543
I am about to write codes for presenting information, in some cases, I will get outputs as a list with a pager. I need your help about deciding between two:
for the people who automaticly ask for code, I am adding some, knowing that it is not actually necessary.
var ccomment= {
commentmin:10,
commentmax:1000,
view:function(commentid){}, //I am planning to present data with this
viewbyopinionid:function(opinionid){},
viewbyactorid:function(actorid){},
insert:function(opinionid,comment){},
remove:function(commentid){}
}
I use PHP and JQuery; I am writing Object Oriented code in both.
Upvotes: 3
Views: 377
Reputation: 2359
Php has a function json_encode which will convert an array to a json compatible string. I'd use that and set the return data type to json.
Upvotes: 2