PHP code example of buzz / laravel-theme

1. Go to this page and download the library: Download buzz/laravel-theme 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/ */

    

buzz / laravel-theme example snippets


<link rel="stylesheet" href="{!! themeAsset('css/bootstrap.css') !!}">
//render <link rel="stylesheet" href="http://domain/themes/theme-name/css/bootstrap.css">

app('theme')->set($themeName)

setTheme($themeName);//function helper

Theme::set($themeName);//use facade

Theme::client();//return object of MobileDetect
Theme::pathTheme($name = null);//return path to current theme or name input
Theme::currentTheme();//return name of current theme
Theme::reset();//reset default theme
Theme::set();//set theme
Theme::allTheme($except = [], $config = true);//get list theme in folder themes
themeAsset($name = false);//link to asset current theme or by theme name
setTheme($name);// change theme by theme name

'aliases' => [
    //.....
    'Validator' => 'Illuminate\Support\Facades\Validator',
    'View'      => 'Illuminate\Support\Facades\View',
    //.....
    'Theme' =>  'Buzz\LaravelTheme\ThemeFacade',
],

├── resources/
    └── themes/
        ├── theme_name/
        |   ├── index.blade.php
        |   ├── footer.blade.php
        |
        └── another_theme_name/