Created
July 3, 2012 13:30
-
-
Save basz/3039707 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // module.config.php | |
| return array( | |
| 'view_manager' => array( | |
| 'strategies' => array( | |
| 'ViewJsonStrategy', // register JSON renderer strategy | |
| ), | |
| ), | |
| ); | |
| // SomeController.php | |
| public function indexAction() | |
| { | |
| return new JsonModel(array('some'=>'data')); | |
| } | |
| // or, you can do IF your browser requests json? (jquery), otherwise it will render with the normal php strategy, which can be handy... | |
| public function indexAction() | |
| { | |
| return new ViewModel(array('some'=>'data')); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment