Advertisement
dragonbe

JSON fetcher

May 9th, 2011
352
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. --- controller actions ---
  2. public function jsonAction()
  3. {
  4.     $data = array ('Zend Framework', 'Symfony', 'Lithium', 'Solar');
  5.     $this->_helper->json($data);
  6. }
  7.  
  8. public function getJsonAction()
  9. {
  10.    
  11. }
  12.  
  13. --- view script: view/scripts/test/get-json.phtml ---
  14. <?php $this->headScript()->appendFile('http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js')?>
  15. <h1>Json fetcher</h1>
  16. <div id="container"></div>
  17. <?php echo $this->inlineScript()->setScript(<<<EOS
  18. jQuery(document).ready(function() {
  19.   jQuery('#container').load('/test/json');
  20. });
  21. EOS
  22. )?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement