CloudObjects / Directory / Web Platform / PlatformSDKInitCodeGenerator
Sign in

PlatformSDKInitCodeGenerator

a phpmae:Class & CodeGeneratorInterface in Web Platform
Public PHP Methods
  • getCode($siteCoid)

    Get the generated content for the module file based on the site configuration.

    @param string|IRI $siteCoid The COID of the website in which the module is loaded.

    @return string

Source Code
<?php

/**
 * Implementation for coid://webplatform.co-n.net/PlatformSDKInitCodeGenerator
 * Using interface coid://webplatform.co-n.net/CodeGeneratorInterface
 */
class PlatformSDKInitCodeGenerator implements CodeGeneratorInterface {

    /**
     * Get the generated content for the module file based on the site configuration.
     * 
     * @param string|IRI $siteCoid The COID of the website in which the module is loaded.
     * 
     * @return string
     */
    public function getCode($siteCoid) {
        return "window.COWebApp = new COWebPlatform(new COID('".(string)$siteCoid."'));";
    }

}
Meta
URI / COID
coid://webplatform.co-n.net/PlatformSDKInitCodeGenerator content_copy
Revision
3-7ebca918929cc12c2748caa73f33c8ce content_copy
Short ID
web:PlatformSDKInitCodeGenerator content_copy
Reference URL
https://coid.link/webplatform.co-n.net/PlatformSDKInitCodeGenerator content_copy
Last updated
2021-04-29 11:43 (UTC)
Created at
2021-04-29 11:39 (UTC)