getRequest(); $controller = $request->getControllerName(); $action = $request->getActionName(); $paramsTheme = Zend_Registry::get('theme'); $fileController = APPLICATION_PATH . '/../public/' . $paramsTheme->pathScript . '/' . $controller . '.js'; if ( file_exists($fileController) ) { $contentScript = file_get_contents($fileController); $view->inlineScript()->appendScript($contentScript); } $fileControllerAction = APPLICATION_PATH . '/../public/' . $paramsTheme->pathScript . '/' . $controller . '-' . $action . '.js'; if ( file_exists($fileControllerAction) ) { $contentScript = file_get_contents($fileControllerAction); $view->inlineScript()->appendScript($contentScript); } } }