Is it possible to write a Zend View Helper that could present the resultset of any fetchAll() operation as a generic table?.
My model code looks like this
class Model_DbTable_XWZ extends Zend_Db_Table_Abstract
{
protected $_name = 'xwz';
protected $_primary = 'id';
public function getA()
{
$sql = $this->select()
....
return $this->fetchAll($sql);
}
public function getB()
{
$sql = $this->select()
......
return $this->fetchAll($sql);
but rather using Zend_Debug::Dump() to view the results, it would be handy to use a generic view helper.
class Zend_View_Helper_DisplayGenericTableHelper extends Zend_View_Helper_Abstract {
public $view;
public function setView(Zend_View_Interface $view)
{
$this->view = $view;
}
public function displayGenericTableHelper($result)
{
....??
}
}
Something like but i'm not sure how to determine the column names from the $result object.