Difference between #83 and #84 of
Yii v2 snippet guide

Revision #84 has been created by rackycz on Sep 20, 2019, 3:39:23 PM with the memo:

edit
« previous (#83) next (#85) »

Changes

Title unchanged

Yii v2 for beginners

Category unchanged

Tutorials

Yii version unchanged

2.0

Tags unchanged

tutorial,beginner,yii2

Content changed

[...]
The setLang action looks like this:

```php
public function actionSetLang($langID = "") {
$allowedLanguages = Yii::$app->params["allowedLanguages"];
if ($langID &&= trim($langID);
 
        if ($langID
!== "" && array_key_exists(trim($langID), $allowedLanguages)) {
Yii::$app->session->set('langID', $langID);
}
return $this->redirect(['site/index']);
}
```
[...]
7 0
4 followers
Viewed: 275 328 times
Version: 2.0
Category: Tutorials
Written by: rackycz
Last updated by: rackycz
Created on: Sep 19, 2019
Last updated: a year ago
Update Article

Revisions

View all history