Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- controller actions ---
- public function jsonAction()
- {
- $data = array ('Zend Framework', 'Symfony', 'Lithium', 'Solar');
- $this->_helper->json($data);
- }
- public function getJsonAction()
- {
- }
- --- view script: view/scripts/test/get-json.phtml ---
- <?php $this->headScript()->appendFile('http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js')?>
- <h1>Json fetcher</h1>
- <div id="container"></div>
- <?php echo $this->inlineScript()->setScript(<<<EOS
- jQuery(document).ready(function() {
- jQuery('#container').load('/test/json');
- });
- EOS
- )?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement