![]() |
If what you want is a dropdown that shows values in the language you're using here is some sample code:
PHP Code: <?php Then in your app/Languages you would create subdirectories for each of your languages let's say your supportedLocales was en, es. You would then create a file called Language.php in each directory. In app/Languages/en/Language.php PHP Code: <?php In app/Languages/es/Language.php PHP Code: <?php CodeIgniter takes care of determining the language you want displayed (based on user's browser settings) and substitutes accordingly. Then you submit/validate however you feel appropriate, push into your session, and your code in your BaseController's initController method for setting the language becomes: PHP Code: public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) |
Messages In This Thread |
Call to a member function get() on null Error - by Vespa - 06-07-2025, 03:44 AM
RE: Call to a member function get() on null Error - by grimpirate - 06-07-2025, 03:02 PM
RE: Call to a member function get() on null Error - by Vespa - 06-08-2025, 12:12 AM
RE: Call to a member function get() on null Error - by grimpirate - 06-08-2025, 06:03 PM
|