// Register a new theme SugarThemeRegistry::register('my_theme', 'My Theme', array( 'css' => array( 'custom.css', 'theme.css' ), 'images' => array( 'logo.png' ), 'javascript' => array( 'custom.js', 'theme.js' ) )); // Override an existing CSS file SugarThemeRegistry::addCss('my_theme', 'custom.css', 'custom-overriding.css');
// Get the current active theme $activeTheme = SugarThemeRegistry::getActiveTheme(); // Get the CSS files of the current active theme $cssFiles = SugarThemeRegistry::getCssFiles($activeTheme); // Print out the CSS files foreach ($cssFiles as $cssFile) { echo ''; }In this example, we get the current active theme and its CSS files using the SugarThemeRegistry. We then print out the CSS files using a loop. This example can be used in a SugarCRM template to dynamically load the CSS files of the current active theme. Package Library: SugarThemeRegistry is part of the SugarCRM package library.