Add dynamic prefix into url

Dear guys,

I want to add dynamic prefix into url

How do it by cakephp, please?

Sorry if i have post mistake.

Example:
when user choose location en-us or ja-jp. url or category-machine, category-sport became as bellow

xxx.com/en-us/category-machine/ads/
xxx.com/ja-jp/category-sport/ads/

What version of CakePHP?

I didn’t do it.but i think you can do it.You must load model on route and generate prefix with all fields on your Model.that is hard.I don’t know what is good way.search in github maybe you will find a plugin or component.good luck

thank you for reading,
I’m using cakephp 3.2

thank for reading,
i have searched on github but have not plugin,
you can write some simple demo to do it?

This plugin should do what you need:
https://github.com/CakeDC/i18n

Updated: Did not notice the Cakephp version, for Cake 3 check:

1 Like

thank guys
i will try it now