Closed jacqueslareau closed 9 years ago
I can confirm that this is working in 0.15. Tried with Text::Xslate, not TT, but still settings.environment
is definitely available.
Can probably be closed.
Just tested and still doesn't work.
Having a test for it would help us resolve the conflict. :)
https://github.com/PerlDancer/Dancer2/pull/671 My conclusion: if the environment is explicitly set in the settings or in the app (via the 'set' keyword), then the 'settings.environment' is working as it should. But if it is not set explicitly, then it returns an empty string (i quess), i.e. no default value is used.
@jacqueslareau Do you have the environment set somewhere in the config?
Should D2::C::App.pm line 498 sub _build_default_config {} include the environment?
I think I wasn't clear enough. In D1, Dancer provided the currently loaded environment without having to set it anywhere in the config. Since Dancer knows what is the environment, it was just convenient to have it available in the templates via settings.
Is it a change or a bug? It's not that big of a deal, but if it's a change, it's a breaking one and should go into the migration guide.
Fixed by #808. Thanks!
[% if settings.environment == "development" %]
Was working in Dancer1, not anymore.