Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class App_Plugin_DojoLayer extends Zend_Controller_Plugin_Abstract
- {
- public $layerScript = APPLICATION_PATH . '/../public/js/custom/main.js';
- protected $_build;
- public function dispatchLoopShutdown()
- {
- if (!file_exists($this->layerScript)) {
- $this->generateDojoLayer();
- }
- }
- public function getBuild()
- {
- if (null === $this->_build) {
- $this->_build = new Zend_Dojo_BuildLayer(array(
- 'view' => $view,
- 'layerName' => 'custom.main',
- ));
- }
- return $this->_build;
- }
- public function generateDojoLayer()
- {
- $build = $this->getBuild();
- $layerContents = $build->generateLayerScript();
- if (!dir_exists(dirname($this->layerScript))) {
- mkdir(dirname($this->layerScript));
- }
- file_put_contents($this->layerScript, $layerContents);
- }
- }
Add Comment
Please, Sign In to add comment