2009年10月29日星期四

Re: [fw-db] How to assign typical Zend Db Query Object into Array

Enkhbilguun Erdenetsogt wrote:
> Hello,
>
> I'm learning Ajax with Zend Framework, and I just want to make my
> typical Zend Db Query Object (fetchAll()ed) to Json encoding ready array.
>
> Can someone help me?
>
> Thank you very much in advance.
>
>
> Sincerely,
>
> Enkhbilguun Erdenetsogt

You can do (in your controller):

$results = $table->fetchAll()->toArray();

$this->_helper->json($results);

Hope that helps

没有评论: