code/LeftAndMain.php
public function getCombinedClientConfig()
    {
        $combinedClientConfig = ['sections' => []];
        $cmsClassNames = CMSMenu::get_cms_classes(LeftAndMain::class, true, CMSMenu::URL_PRIORITY);

        // append LeftAndMain to the list as well
        $cmsClassNames[] = LeftAndMain::class;
        foreach ($cmsClassNames as $className) {
            $combinedClientConfig['sections'][] = Injector::inst()->get($className)->getClientConfig();
        }

        // Pass in base url (absolute and relative)
        $combinedClientConfig['baseUrl'] = Director::baseURL();
        $combinedClientConfig['absoluteBaseUrl'] = Director::absoluteBaseURL();
        $combinedClientConfig['adminUrl'] = AdminRootController::admin_url();

        // Get "global" CSRF token for use in JavaScript
        $token = SecurityToken::inst();
        $combinedClientConfig[$token->getName()] = $token->getValue();

        // Set env
        $combinedClientConfig['environment'] = Director::get_environment_type();
        $combinedClientConfig['debugging'] = LeftAndMain::config()->uninherited('client_debugging');

        return json_encode($combinedClientConfig);
    }
public function getCombinedClientConfig()
    {
        $combinedClientConfig = ['sections' => []];
        $cmsClassNames = CMSMenu::get_cms_classes(LeftAndMain::class, true, CMSMenu::URL_PRIORITY);

        // append LeftAndMain to the list as well
        $cmsClassNames[] = LeftAndMain::class;
        foreach ($cmsClassNames as $className) {
            $combinedClientConfig['sections'][] = Injector::inst()->get($className)->getClientConfig();
        }

        // Pass in base url (absolute and relative)
        $combinedClientConfig['baseUrl'] = Director::baseURL();
        $combinedClientConfig['absoluteBaseUrl'] = Director::absoluteBaseURL();
        $combinedClientConfig['adminUrl'] = AdminRootController::admin_url();

        // Get "global" CSRF token for use in JavaScript
        $token = SecurityToken::inst();
        $combinedClientConfig[$token->getName()] = $token->getValue();

        // Set env
        $combinedClientConfig['environment'] = Director::get_environment_type();
        $combinedClientConfig['debugging'] = LeftAndMain::config()->uninherited('client_debugging');

        return json_encode($combinedClientConfig);
    }
public function getCombinedClientConfig ( ) { $ combinedClientConfig = [ 'sections' => [ ] ] ; $ cmsClassNames = CMSMenu :: get_cms_classes ( LeftAndMain :: class , true , CMSMenu :: URL_PRIORITY ) ; // append LeftAndMain to the list as well $ cmsClassNames [ ] = LeftAndMain :: class ; foreach ( $ cmsClassNames as $ className ) { $ combinedClientConfig [ 'sections' ] [ ] = Injector :: inst ( ) -> get ( $ className ) -> getClientConfig ( ) ; } // Pass in base url (absolute and relative) $ combinedClientConfig [ 'baseUrl' ] = Director :: baseURL ( ) ; $ combinedClientConfig [ 'absoluteBaseUrl' ] = Director :: absoluteBaseURL ( ) ; $ combinedClientConfig [ 'adminUrl' ] = AdminRootController :: admin_url ( ) ; // Get "global" CSRF token for use in JavaScript $ token = SecurityToken :: inst ( ) ; $ combinedClientConfig [ $ token -> getName ( ) ] = $ token -> getValue ( ) ; // Set env $ combinedClientConfig [ 'environment' ] = Director :: get_environment_type ( ) ; $ combinedClientConfig [ 'debugging' ] = LeftAndMain :: config ( ) -> uninherited ( 'client_debugging' ) ; return json_encode ( $ combinedClientConfig ) ; }
Gets the combined configuration of all LeftAndMain subclasses required by the client app.

@return string

WARNING: Experimental API
Gets the combined configuration of all LeftAndMain subclasses required by the client app .