igaster / laravel-theme

Theme support for Laravel
MIT License
516 stars 110 forks source link

Theme vs. Themes #5

Closed TheDigitalOrchard closed 9 years ago

TheDigitalOrchard commented 9 years ago

I'm trying to use this Laravel-Theme package and I'm a bit confused. There seems to be some confusion about whether the word "theme" or "themes" should be used.

  1. In the README, it makes reference to a "theme.php" config file, but the file that actually gets installed is "themes.php" (plural), and this name makes more sense.
  2. Also, to set a theme, the docs say to use Theme::set('theme-name'), but when I look at the Theme class, it does not have a set() method. However, when I look at the Themes.php file (different from Theme.php), the set() method does exist.

It appears to be setting a theme when I call Theme::set('my-theme-name'), but then does not correctly use the views-path that I have configured. It's possible that it's not loading it from the environment-specific themes.php config file. Still investigating that.

TheDigitalOrchard commented 9 years ago

Problem 2 is confirmed – it's not using the environment-specific configuration value for some reason.

If my APP_ENV is set to 'local', the values in config/themes.php are being loaded, but config/local/themes.php is not used.

igaster commented 9 years ago
  1. The correct configuration file is themes.php. I will fix the readme
  2. Actually the Theme facade resolves to the Themes.php class. You can think the Themes.php as a theme manager and Theme.php as a single Theme. I thought that it makes more sence to Theme::set('xxx') than Themes::set('xxx') so I changed the Facade name...

About your issue: Laravel 5 has dropped support for configuring environment using folders. You can check that none of your "local" config files are loading. The proposed way to support per evnironment configuration is to use .env files. Please confirm that I have understand correct your issue

TheDigitalOrchard commented 9 years ago

Yes, thank you. :)