public static function getResource($key) { if (is_null(self::$templateResource) || empty(self::$templateResource)) { self::$templateResource = array(); } // Ensure there is something to work with if (isset(self::$templateResource[$key])) { return self::$templateResource[$key]; } return null; }
<?php require $currentPage; ?> <?php require "footer.php"; ?> <!-- Basic scripts --> <script src="../../material.min.js"></script> <!-- End of basic scripts --> <?php /* * * * Specify the scripts that are to be added. */ if ($templateResource = TemplateResource::getResource('js')) { ?> <!-- Additional Scripts --> <?php foreach ($templateResource as $js) { $js = "web/{$js}"; ?> <script src="<?php echo $js; ?> "></script> <?php } ?> <?php }