Zend framework 2 CSV data as an array or string -
Zend framework 2 CSV data as an array or string -
i still new zend , running issues on exporting info csv.
i found great resource explains headers , download part here running issues when trying export actual data.
if create variable $content = "test" export works fine using code above.
however when duplicate indexaction code, create changes, , bring downloadaction, getting issues believe due content beingness returned object rather array or string.
my module grabbing sql using:
public function fetchallmembers($order = null , $order_by = null, $selectwhere = null) { $session = new sessioncontainer('logggedin_user'); $sql = new sql($this->adapter); $select = new select(); $select->from(array('u' => 'tbl_all_data')); if ($selectwhere != null){ $select->where($selectwhere); } $select->order($order_by . ' ' . $order); $selectstring = $sql->getsqlstringforsqlobject($select); $results = $this->adapter->query($selectstring, adapter::query_mode_execute); $results->buffer(); homecoming $results; } and controller calling sql using:
$content = $modulestable->fetchallmembers($order, $order_by, $where); any help appreciated, , don't need write code me help pointoing me in right direction.
$this->adapter->query returns zend\db\resultset object. need phone call $results = $results->toarray() send array.
also need loop through array , echo out in view file.
zend-framework2
Comments
Post a Comment