Page tree
Skip to end of metadata
Go to start of metadata

Description


null asset(string $asset)


 Include custom assets with your apps. Can be vanilla Javascript to external CSS files.

Parameters


$asset

HTML asset to place inside <head></head> or before </body> depending on the type of asset, unless prefixed with custom namespace.

Examples


// Say hello in the console
asset('<script>console.log("Hello World");</script>');

// Include an external Javascript file
asset('<script src="https://ajax.googleapis.com/ajax/libs/mootools/1.6.0/mootools.min.js"></script>');

// Assign a meta tag
asset('<meta name="author" content="Foo">');

// Use your apps namespace to load local assets in your apps "assets/" folder
asset('@Sample/boot.js');

// Use your apps namespace to load a local CSS asset
asset('@Sample/sample.css');

Note: In the example above, @Sample/ is the namespace for our sample app. You need to replace this with your own App ID.

  • No labels