zend_db_table_rowset オブジェクトを JavaScript 配列に変換する方法
$db=new Application_Model_DbTable_Books();
$result=$db->showBooks();
ショーブック:
class Application_Model_DbTable_Books extends Zend_Db_Table_Abstract
{
protected $_name = 'books';
protected $_primary = 'id';
public function showBooks(){
return $this->fetchAll();
}
結果セットを次のようなものに変換したい:
var aDataSet = [
['Trident','Internet Explorer 4.0','Win 95+','4','X'],
['Trident','Internet Explorer 5.0','Win 95+','5','C'],
['Trident','Internet Explorer 5.5','Win 95+','5.5','A'],
['Trident','Internet Explorer 6','Win 98+','6','A']];