conflict with method name |
Hi! i use localization in CI 4.1.1. I have a controller for each language and inside any controller there is a method called blog.
Method blog in italian controller: PHP Code: public function blog() Method blog in english controller: PHP Code: public function blog() My routes: PHP Code: $routes->add('{locale}/blog', 'It/Main::blog'); The result is always the same..it is called only the method blog in "italian controller". Codeigniter show the first route found, so in this case for the "italian controller". Thanks for the support.
"You either take off the cross or put on your panties."(с)
From a framework perspective, you are defining the same URL mask. Choose the right way. PHP Code: $routes->add('{locale}/blog', 'Main::blog'); (02-23-2021, 09:39 PM)iRedds Wrote: "You either take off the cross or put on your panties."(с) Hi @iRedds. Thank for reply. if I use your route, for example this: PHP Code: $routes->add('it/blog', 'It/Main::blog'); the page is correct but the main.php is not traslate in English. Please, watch my screen: https://demo.samuelesantoni.com/host/route-blog.png Thanks for help me.
Perhaps you include the template (main.php) from the IT directory. I don't know how your code works. =)
|
Welcome Guest, Not a member yet? Register Sign In |