Welcome Guest, Not a member yet? Register   Sign In
Multilanguage service
#1

Hi,

What I want to accomplish is a multilanguage web service, where language is determined by first two characters after base_url. That is, when user enters "example.com/en/someController/someMethod" it will fire up the someMethod in someController, but before doing that, it will set a global (actually defined in My_Controller) variable to 'en'.

I know I can handle this by using routes, and passing the language code as first parameter to methods, but this requires a lof of work, plus, we have a lot of existing code, and modifying it would be a nightmare.

So I thougt, that maybe using hooks is the way to go? There is a "pre_controller" hook, Is this possible to get an uri segment and then call a controller/method or maybe rather to alter routes dynamically from there?
Reply


Messages In This Thread
Multilanguage service - by konrados - 11-06-2014, 07:01 AM
RE: Multilanguage service - by GrigoreMihai - 11-06-2014, 08:23 AM
RE: Multilanguage service - by michalsn - 11-06-2014, 12:14 PM
RE: Multilanguage service - by konrados - 11-06-2014, 11:14 PM
RE: Multilanguage service - by marcogmonteiro - 11-07-2014, 04:10 AM
RE: Multilanguage service - by konrados - 11-07-2014, 04:18 AM
RE: Multilanguage service - by GrigoreMihai - 11-07-2014, 07:21 AM
RE: Multilanguage service - by karthik_code - 12-27-2014, 03:58 AM
RE: Multilanguage service - by Rufnex - 12-27-2014, 09:53 AM
RE: Multilanguage service - by benny - 12-30-2014, 03:35 AM
RE: Multilanguage service - by Rufnex - 12-30-2014, 01:26 PM
RE: Multilanguage service - by carlosH - 08-29-2015, 04:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB