Head HTML
Head HTML for every page is loaded in two places:
- The core HeadHtml.php file, which loads the core libraries and CSS stylesheets needed for all pages, and inserts the CSRF token.
- Each page's own <head> tag, where page-specific content is loaded.
In production, a single css file, productionstyles.css, is loaded (to reduce HTTP request overhead). In test enrivonments, the main CSS files used by most pages are loaded individually.
Code Hierarchy
Base path: src/Core/Includes/Head/
Path (relative to base path) | Notes |
HeadHtml.php |
The main file included by all pages, via the StaticContent class in src/Core/StaticContent.php.
This file loads all commonly used CSS/JS, and decides whether to use test or production versions. |
Imports/HeadScriptImports.php | Included once by HeadHtml.php to add all commonly used JS scripts to the head of each page. |
Imports/HeadTestCssImports.php |
If the WebConfig::USE_PRODUCTION_CSS value is set to true, this file is included once by HeadHtml.php to add each of the individual CSS files to the page head.
Otherwise, HeadHtml.php loads the production CSS, productionstyles.css, which reduces HTTP overhead. |