Closed GoogleCodeExporter closed 8 years ago
Puede ser algo así:
$json = "";
foreach($comentarios as $comentario)
{
$json .= JSONPO::toJSON( $comentario ) . ", ";
}
$json = substr($json, 0, -2);
return '{"comentarios":['. $json .']}';
o así:
$json = '[';
foreach ($modules as $module)
{
$json .= JSONPO::toJSON( $module ) .', ';
}
$json = substr($json, 0, -2);
$json .= ']';
Original comment by pablo.swp@gmail.com
on 2 Jan 2012 at 1:31
Aparte de armar el array json es necesario hacer el loopDetection.
Puedo reusar el código de toJSON para procesar hasMany.
Original comment by pablo.swp@gmail.com
on 8 Apr 2012 at 9:43
Hecho.
Original comment by pablo.swp@gmail.com
on 8 Apr 2012 at 6:52
Original issue reported on code.google.com by
pablo.swp@gmail.com
on 2 Jan 2012 at 1:26