I am facing an issue. I have a code in Yii1 that allows me to change the language on my site.
echo CHtml::ajaxLink('EN', array('/'), array(
'type' => 'POST',
'success' => 'js:function(res){window.location.reload();}',
'data' => array(
Yii::app()->request->csrfTokenName => Yii::app()->request->csrfToken,
'_lang' => 'en',
)
), array('class' => 'lang_class'));
I need help converting this code to Yii2 as I am new to it and struggling to do so. Thank you for your assistance!