/** * Include a theme asset * * @param string $path * @return string */ function theme_asset_tag($path = null) { $path = theme_asset($path); $ext = pathinfo($path, PATHINFO_EXTENSION); if ($ext == 'js') { return '<script src="' . $path . '"></script>' . PHP_EOL; } elseif ($ext == 'css') { return '<link rel="stylesheet" href="' . $path . '">' . PHP_EOL; } elseif ($ext == 'jpg') { return '<img src="' . $path . '">' . PHP_EOL; } else { return $path . PHP_EOL; } }
/** * Generate a secure asset path for the theme asset. * * @param string $path * @return string */ function secure_theme_asset($path) { return theme_asset($path, true); }