Last active
August 29, 2015 14:02
-
-
Save lucasff/b1cb6494dc169a11e7ec to your computer and use it in GitHub Desktop.
CakePHP params on JavaScript
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 | |
/** @var View $this */ | |
$paths = array(); | |
$paths['sid'] = $this->Session->id(); | |
$paths['domain'] = $_SERVER['SERVER_NAME']; | |
$paths['basename'] = $this->base; | |
$paths['basePath'] = Router::url('/'); | |
$paths['controller'] = $this->params['controller']; | |
$paths['action'] = $this->params['action']; | |
$paths['url'] = $this->params['url']['url']; | |
$paths['here'] = $this->here; | |
$paths['params'] = array( | |
'controller' => $this->params['controller'], | |
'action' => $this->params['action'], | |
'named' => $this->params['named'] | |
); | |
echo $this->Js->value($paths); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment