Skip to content

Instantly share code, notes, and snippets.

@vitorpacheco
Created May 28, 2013 12:53
Show Gist options
  • Select an option

  • Save vitorpacheco/5662566 to your computer and use it in GitHub Desktop.

Select an option

Save vitorpacheco/5662566 to your computer and use it in GitHub Desktop.
public function js() {
$uneb = array();
$uneb['basePath'] = Router::url('/');
$uneb['params'] = array(
'controller' => $this->request->params['controller'],
'action' => $this->request->params['action'],
'named' => $this->request->params['named'],
);
if (is_array(Configure::read('Js'))) {
$uneb = Set::merge($uneb, Configure::read('Js'));
}
return $this->Html->scriptBlock('var Uneb = ' . $this->Js->object($uneb) . ';');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment