PHP code example of aldrumo / theme-manager

1. Go to this page and download the library: Download aldrumo/theme-manager library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

aldrumo / theme-manager example snippets


    $themeCollection = resolve(\Aldrumo\ThemeManager\ThemeManager::class)->availableThemes();

    resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme('ThemeName');

    // throws \Aldrumo\ThemeManager\Exceptions\ActiveThemeNotSetException
    resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme();

    // throws \Aldrumo\ThemeManager\Exceptions\ThemeNotFoundException
    resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme('MissingTheme');

    resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme('ThemeName');

    $themeBase = resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme();

    // runs uninstall on OldTheme ThemeBase file
    // runs install on NewTheme ThemeBase file
    // runs activeTheme for NewTheme  
    resolve(\Aldrumo\ThemeManager\ThemeManager::class)->installTheme('NewTheme', 'OldTheme');

    $themeBase = resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme();

    $viewsCollection = $themeBase->availableViews();

    $themeBase = resolve(\Aldrumo\ThemeManager\ThemeManager::class)->activeTheme();

    $themeBase->install();
    $themeBase->uninstall();