Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
Question about event and lang class
itcan
February 2015
Hi, is it wise to add a "controller_started" event where I load and set the User's language ? like this:
```
return array(
'fuelphp' => array(
// Before controllers before() method called
'controller_started' => function()
{
setlocale(LC_TIME, \Auth::get('locale', 'nl_NL'
));
\Config::set('language',
\Auth::get('language', 'nl'
)
);
\Lang::load('List');
},
),
);
```
Is this a good way to do this?
Harro
February 2015
See
https://github.com/fuel/core/issues/1839
I assume this is your reason for asking here.
itcan
February 2015
yeah the fallback stuff is clear now... Is the event a good way to load a user defined language?
Harro
February 2015
It doesn't really matter where you do it, I usually do it in the before method of the base controller.
It was clear that you can pass an array of languages to both language and fallback_language if you want a lets call it a "user defined fallback"?
itcan
February 2015
Yeah it's all clear now! Thanks
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
February 2015
itcan
February 2015