* @link https://TheTempusProject.com/Core * @license https://opensource.org/licenses/MIT [MIT LICENSE] */ namespace TheTempusProject\Houdini\Classes; use TheTempusProject\Houdini\Classes\Components; class Loader { protected $cssIncludes = []; protected $jsIncludes = []; public function buildComponents() { Components::append( 'TEMPLATE_CSS_INCLUDES', implode( "\n", $this->cssIncludes ) ); Components::append( 'TEMPLATE_JS_INCLUDES', implode( "\n", $this->jsIncludes ) ); } public function addCss( $text, $parse = true ) { if ( $parse ) { $text = Template::parse( $text ); } $this->cssIncludes[] = $text; } public function addJs( $text, $parse = true ) { if ( $parse ) { $text = Template::parse( $text ); } $this->jsIncludes[] = $text; } }