1. Go to this page and download the library: Download velka/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/ */
velka / theme example snippets
return [
/*
|--------------------------------------------------------------------------
| Path to directory with themes
|--------------------------------------------------------------------------
|
| The directory with your themes.
|
*/
'path' => base_path('themes'),
/*
|--------------------------------------------------------------------------
| Path to directory with assets build
|--------------------------------------------------------------------------
|
| The directory with assets build in public directory.
|
*/
'assets_path' => 'themes',
/*
|--------------------------------------------------------------------------
| A pieces of theme collections
|--------------------------------------------------------------------------
|
| Inside a theme path we need to set up directories to
| keep "layouts", "assets" and "partials".
|
*/
'containerDir' => [
'assets' => 'assets',
'lang' => 'lang',
'layout' => 'views/layouts',
'partial' => 'views/partials',
'view' => 'views',
],
];
return [
/*
|--------------------------------------------------------------------------
| Theme name
|--------------------------------------------------------------------------
|
| Use in assets publishing etc.
|
*/
'name' => '%theme_name%',
/*
|--------------------------------------------------------------------------
| Inherit from another theme
|--------------------------------------------------------------------------
|
| Set up inherit from another if the file is not exists.
|
*/
'inherit' => null,
];
use YAAP\Theme\Facades\ThemeLoader;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
ThemeLoader::init('default');
}
}
View::make('hello');
View::make('emails.notify');
// or
view('hello');
view('emails.notify');