Matthew Weier O'Phinney a écrit : > ... > > Should be fixed now -- please test! > > >
Thank you :-)
$p= new Catalogue();
$rows= $p->fetchAll()->toArray();
$f= new Zend_Dojo_Data();
$f->setIdentifier('produit');
$f->addItems( $rows );
/*
$array = array(
'identifier' => 'produit',
'items' => $rows,
);
*/
// context is json
$this->getResponse()->setBody( $f );
renders:
{"identifier":"produit",
"items":[
{"id":"1","produit":"pomme"},
{"id":"2","produit":"orange"},
]}
FT
