Skip to content

Instantly share code, notes, and snippets.

@henrikbjorn
Created March 15, 2009 20:55
Show Gist options
  • Save henrikbjorn/79533 to your computer and use it in GitHub Desktop.
Save henrikbjorn/79533 to your computer and use it in GitHub Desktop.
<?php
class JsModuleActionFilter extends sfFilter
{
public function execute($filterChain)
{
if ($this->isFirstCall()) {
$params = $this->getContext()->getRequest()->getRequestParameters();
//gets a module action specific js file
$this->getContext()->getResponse()->addJavascript('modules/' . $params['module'] . '_' . $params['action'] , 'last');
}
$filterChain->execute();
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment