Fix issue with SKIN_NAME being undefined

This commit is contained in:
Nabeel Shahzad
2018-03-11 10:55:20 -05:00
parent 2ec7bc1caa
commit df8f6372f1
2 changed files with 9 additions and 9 deletions

View File

@@ -1,26 +1,25 @@
<?php
namespace App\Providers;
use App\Repositories\SettingRepository;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
use View;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*/
public function boot()
public function boot(): void
{
Schema::defaultStringLength(191);
$this->app->bind('setting', SettingRepository::class);
View::share('SKIN_NAME', config('phpvms.skin'));
}
/**
* Register any application services.
*/
public function register()
public function register(): void
{
}

View File

@@ -93,11 +93,12 @@ if (!function_exists('skin_view')) {
{
# Add the current skin name so we don't need to hardcode it in the templates
# Makes it a bit easier to create a new skin by modifying an existing one
$merge_data['SKIN_NAME'] = config('phpvms.skin');
$tpl = 'layouts/' . config('phpvms.skin') . '/' . $template;
if(View::exists($template)) {
return view($template, $vars, $merge_data);
}
# TODO: Look for an overridden template in a special folder
$tpl = 'layouts/' . config('phpvms.skin') . '/' . $template;
return view($tpl, $vars, $merge_data);
}
}