JSON Zend framework


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2.  
  3. class IndexController extends Zend_Controller_Action
  4. {
  5.  
  6. public function init()
  7. {
  8. /* Initialize action controller here */
  9. }
  10.  
  11. public function indexAction()
  12. {
  13. $this->getHelper('ViewRenderer')->setNoRender(true);
  14. $values = array('foo' => 'bar');
  15. $this->getHelper('json')->sendJson($values);
  16. }
  17. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.