Skip to content

Instantly share code, notes, and snippets.

@kirkegaard
Created March 12, 2010 11:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kirkegaard/330237 to your computer and use it in GitHub Desktop.
Save kirkegaard/330237 to your computer and use it in GitHub Desktop.
<?php
class App_Controller_Plugin_LayoutSwitcher extends Zend_Layout_Controller_Plugin_Layout {
public function preDispatch(Zend_Controller_Request_Abstract $request) {
$this->getLayout()->setLayoutPath(
Zend_Controller_Front::getInstance()->getModuleDirectory(
$request->getModuleName()
) . '/views/layouts'
);
$this->getLayout()->setLayout('default');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment