Guest User

Untitled

a guest
Oct 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. class ContextSwitch extends \Zend_Controller_Action_Helper_AjaxContext
  2. {
  3. protected $_contextKey = 'ajaxable';
  4.  
  5. public function __construct()
  6. {
  7. parent::__construct();
  8. $this->addContext('ajax',array(
  9. 'suffix' => 'ajax',
  10. 'headers' => array('Content-Type' => 'application/jsonp'),
  11. 'callbacks' => array(
  12. 'init' => array($this,"initAjax"),
  13. )
  14. ));
  15. }
  16. public function initAjax(){
  17. \Zend_Controller_Action_HelperBroker::getStaticHelper('layout')->setLayout('ajax');
  18. }
  19. }
Add Comment
Please, Sign In to add comment