Is it possible to write a Zend View helper that could present the result set of any fetchAll () operation as a common table ?.
My model code is as follows
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 instead of using Zend_Debug :: Dump () to view the results, it would be useful 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.
source
share