Hi,
How do I set in Yii2 the equivalent to :
'urlManager'=>[
'urlFormat'=>'path',
I would like to use
http://localhost/skate/site/index/lang/en.sk
instead of
http://www.lernius.org/skate/site/index.sk?lang=en
just like I used to to in yii 1.1
is this possible?
right now this url returns a not found error:
http://localhot/skate/index.php/site/index/lang=pt.sk
My SiteController:
public function actionIndex($lang='')
{
if ($lang!=''):
yii::$app->language = $lang;
Yii::$app->session->set('lang',$lang);
endif;
return $this->render('index');
}
My config:
'urlManager'=>[
//'urlFormat'=>'path',
'enablePrettyUrl' => true,
'showScriptName' => false,
'suffix'=>'.sk',
'rules'=>[
// '<controller:\w+>/<id:\d+>'=>'<controller>/view',
// '<controller:\w+>/<action:\w+>/<id:\w+>'=>'<controller>/<action>',
// '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
],
],
Thank you