Registering JS and CSS

Adding scripts and styles to the site can be done through the $factory class.

Javascript

The following are examples of adding javascript files.

$factory->register_script("reactor", "theme/" . SITE_THEME . "/scripts/reactor.js",true);
$factory->register_script("reactor-ajax", "theme/" . SITE_THEME . "/scripts/ajax.js",true);
$factory->register_script("reactor-upload", "theme/" . SITE_THEME . "/scripts/upload.chunked.js",true);
$factory->register_script("reactor-editor", "theme/" . SITE_THEME . "/scripts/editor.js",true);

Cascading Stylesheets

The following are examples of adding CSS files.

$factory->register_style("reactor-widescreen", "theme/" . SITE_THEME . "/styles/sizes/reactor.widescreen.css", true);
$factory->register_style("reactor-mobile", "theme/" . SITE_THEME . "/styles/sizes/reactor.mobile.css", true);

Description of the main PHP Engine loop.
Protected pages are page names that cannot be used for normal pages.
Learn how to create new plugins from scratch.
Learn how to build new themes from scratch.
Register new scripts and stylesheets.
Register new types to the core.
Register a new theme to the core.
We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.
Do you want to accept tracking cookies?