Created
August 3, 2011 15:04
-
-
Save AV4TAr/1122844 to your computer and use it in GitHub Desktop.
Javascript Helper Zend Framework MVC
This file contains 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 | |
class Zend_View_Helper_JavascriptHelper extends Zend_View_Helper_Abstract | |
{ | |
function javascriptHelper() { | |
$request = Zend_Controller_Front::getInstance()->getRequest(); | |
$file_uri = 'js/' . $request->getControllerName() . '/' . $request->getActionName() . '.js'; | |
if (file_exists($file_uri)) { | |
$this->view->headScript()->appendFile('/' . $file_uri); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment