05-10-2011, 08:11 AM
[eluser]ThatAirplaneGuy[/eluser]
I would like to be able to detect the user's platform via user_agent library during config load. Depending on what platform the user is running, I will set an 'ENV_TYPE' config variable that I will access throughout the application to create different views, menus, functionality, etc.
I know I can do the user_agent detection in the default controller, but if I link to a separate controller and bypass the default controller, I would bypass the platform detection and would need the platform detection in every one of my controllers. I would rather have it done at the core application level, and let the config variable be accessible by all controllers afterwards.
I have the user_agent library in autoload, but I can't access the library in config.php.
Am I missing an easy fix? Any ideas?
Thanks ahead of time...
CJ
I would like to be able to detect the user's platform via user_agent library during config load. Depending on what platform the user is running, I will set an 'ENV_TYPE' config variable that I will access throughout the application to create different views, menus, functionality, etc.
I know I can do the user_agent detection in the default controller, but if I link to a separate controller and bypass the default controller, I would bypass the platform detection and would need the platform detection in every one of my controllers. I would rather have it done at the core application level, and let the config variable be accessible by all controllers afterwards.
I have the user_agent library in autoload, but I can't access the library in config.php.
Am I missing an easy fix? Any ideas?
Thanks ahead of time...
CJ