ZEND: Return HTML as string using Render? -
i have:
$this->_helper->layout->disablelayout(); $this->_helper->viewrenderer->setnorender(); $this->render("voucher-list");
the problem is, when execute:
$this->render("voucher-list");
it prints information screen. want return data html string. not work:
$htmlcontent = $this->render("voucher-list");
how go returning information string?
if want send data json format need make array of data , use following code send data:
$data = array(3,4,'test', 'my-name' => 3,4); //suppose data $this->_helper->viewrenderer->setnorender(true); $this->view->layout()->disablelayout(); echo zend_json::encode($data);
and data in json format.
see this: zend framework json output
Comments
Post a Comment