Getting all translation page slugs

As im new to yii2 im trying to get all available translation page slugs, so for example I want to loop all page slugs on the same page (available translatiosn are for example en, de,es) as im trying to add all correct hreflang attribute to the code.

Atm it only shows the current language slug.

Hi mark, welcome to the forum.

What do you mean by "page slugs"? Would you please explain by an example?

well im new to yii2, so im trying to get all translated urls, below is an example. I want to add all translated available urls on the same page which i want to use for the hreflang attribute.

<link rel="alternate" href="www.example.com/about" hreflang="en"/>

<link rel="alternate" href="www.example.com/nl/over-ons" hreflang="nl"/>

<link rel="alternate" href="www.example.com/de/uber-uns" hreflang="de"/>

<link rel="alternate" href="www.example.com/es/sobre-nosotros" hreflang="es"/>

It looks not very easy at first sight.

Guide > I18N

http://www.yiiframework.com/doc-2.0/guide-tutorial-i18n.html

Guide > Routing and URL Creation

http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html

Thanks, but could not find any solution for my question in these docs.

Hi Mark

Have you tried this https://github.com/DevGroup-ru/yii2-multilingual-demo