Support the ongoing development of Laravel.io →
Views Blade Packages
Last updated 2 years ago.
0

Hi,

nice package!

I'm not so experienced in Laravel, however, in order to hot-switch themes, I tried to change the "set" function in Themes class as follows:

	// Set active theme (by name)
	public function set($themeName){
		$theme = $this->find($themeName);
		$this->activeTheme = $theme;

		$paths = [];
		do {
			$paths[] = $this->defaultViewsPath.'/'.$theme->viewsPath;
		} while ($theme = $theme->getParent());

		Config::set('view.paths', $paths);

        App::rebinding('view.finder', function($app)
        {
            $paths = $app['config']['view.paths'];

            return new FileViewFinder($app['files'], $paths);
        });

        View::setFinder(app('view.finder'));

    }

I don't know if it is a good idea to call App::rebinding outside of a service provider but it seems to work for now. Thanks

Last updated 9 years ago.
0

I've already merged your submition in the latest version.... Thanks!

0

Good! I'm pleased to have been helpful! :)

0

Really good package.

Can we extend more than one theme ?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

igaster igaster Joined 13 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.