Skip to content

Instantly share code, notes, and snippets.

@andrebian
Last active December 22, 2015 02:08
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 andrebian/6400683 to your computer and use it in GitHub Desktop.
Save andrebian/6400683 to your computer and use it in GitHub Desktop.
<?php
$this->Js->buffer('$(\'.'.$this->request->params['controller'].'\').addClass(\'current\');');
if (class_exists('JsHelper') && method_exists($this->Js, 'writeBuffer')) {
echo $this->Js->writeBuffer();
}
// ...
?>
Ou diretamente via jQuery
<script>
$("<?php echo $this->request->params['controller']; ?>").addClass("current");
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment