src/View/Helper/JsHelper.php
protected function _setScriptVars()
    {
        $request = $this->request;
        $vars = [
            'baseUrl' => Router::fullBaseUrl(),
            'alert' => [
                'ok'     => __d('alert', 'Ok'),
                'cancel' => __d('alert', 'Cancel'),
                'sure'   => __d('alert', 'Are you sure?'),
            ],
            'request' => [
                'url'    => $request->getPath(),
                'params' => [
                    'pass'       => $request->getParam('pass'),
                    'theme'      => $request->getParam('theme'),
                    'action'     => $request->getParam('action'),
                    'prefix'     => $request->getParam('prefix'),
                    'plugin'     => $request->getParam('plugin'),
                    'controller' => $request->getParam('controller'),
                ],
                'query'  => $this->request->getQueryParams(),
                'base'   => $request->getAttribute('base'),
                'here'   => $request->getRequestTarget(),
            ]
        ];

        $this->Html->scriptBlock('window.CMS = ' . json_encode($vars), ['block' => 'css_bottom']);
    }
protected function _setScriptVars()
    {
        $request = $this->request;
        $vars = [
            'baseUrl' => Router::fullBaseUrl(),
            'alert' => [
                'ok'     => __d('alert', 'Ok'),
                'cancel' => __d('alert', 'Cancel'),
                'sure'   => __d('alert', 'Are you sure?'),
            ],
            'request' => [
                'url'    => $request->getPath(),
                'params' => [
                    'pass'       => $request->getParam('pass'),
                    'theme'      => $request->getParam('theme'),
                    'action'     => $request->getParam('action'),
                    'prefix'     => $request->getParam('prefix'),
                    'plugin'     => $request->getParam('plugin'),
                    'controller' => $request->getParam('controller'),
                ],
                'query'  => $this->request->getQueryParams(),
                'base'   => $request->getAttribute('base'),
                'here'   => $request->getRequestTarget(),
            ]
        ];

        $this->Html->scriptBlock('window.CMS = ' . json_encode($vars), ['block' => 'css_bottom']);
    }
protected function _setScriptVars ( ) { $ request = $ this -> request ; $ vars = [ 'baseUrl' => Router :: fullBaseUrl ( ) , 'alert' => [ 'ok' => __d ( 'alert' , 'Ok' ) , 'cancel' => __d ( 'alert' , 'Cancel' ) , 'sure' => __d ( 'alert' , 'Are you sure?' ) , ] , 'request' => [ 'url' => $ request -> getPath ( ) , 'params' => [ 'pass' => $ request -> getParam ( 'pass' ) , 'theme' => $ request -> getParam ( 'theme' ) , 'action' => $ request -> getParam ( 'action' ) , 'prefix' => $ request -> getParam ( 'prefix' ) , 'plugin' => $ request -> getParam ( 'plugin' ) , 'controller' => $ request -> getParam ( 'controller' ) , ] , 'query' => $ this -> request -> getQueryParams ( ) , 'base' => $ request -> getAttribute ( 'base' ) , 'here' => $ request -> getRequestTarget ( ) , ] ] ; $ this -> Html -> scriptBlock ( 'window.CMS = ' . json_encode ( $ vars ) , [ 'block' => 'css_bottom' ] ) ; }
Setup java script variables from server.

@return void
Setup java script variables from server .