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
+5 -6
View File
@@ -1,26 +1,25 @@
<?php <?php
namespace App\Providers; namespace App\Providers;
use App\Repositories\SettingRepository; use App\Repositories\SettingRepository;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use View;
class AppServiceProvider extends ServiceProvider class AppServiceProvider extends ServiceProvider
{ {
/** public function boot(): void
* Bootstrap any application services.
*/
public function boot()
{ {
Schema::defaultStringLength(191); Schema::defaultStringLength(191);
$this->app->bind('setting', SettingRepository::class); $this->app->bind('setting', SettingRepository::class);
View::share('SKIN_NAME', config('phpvms.skin'));
} }
/** /**
* Register any application services. * Register any application services.
*/ */
public function register() public function register(): void
{ {
} }
+4 -3
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 # 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 # Makes it a bit easier to create a new skin by modifying an existing one
$merge_data['SKIN_NAME'] = config('phpvms.skin'); if(View::exists($template)) {
$tpl = 'layouts/' . config('phpvms.skin') . '/' . $template; return view($template, $vars, $merge_data);
}
# TODO: Look for an overridden template in a special folder # TODO: Look for an overridden template in a special folder
$tpl = 'layouts/' . config('phpvms.skin') . '/' . $template;
return view($tpl, $vars, $merge_data); return view($tpl, $vars, $merge_data);
} }
} }