How to Encrypt Yii2 url -
i want encrypt yii2 url parameters example: http://localhost/school/backend/web/index.php?r=user%2fview&id=20
20 must encrypt.
whats simplest way in yii2 achieve this.
you can use this. if have lot of parameters don't advice because performance problems. if still want can send data 1 parameter encode json. decrease process count 1 time encrypt decrypt.
$decrypt = \yii::$app->security->decryptbykey($_get['id'], \yii::$app->request->cookievalidationkey); $encrypt=\yii::$app->security->encryptbykey($id, \yii::$app->request->cookievalidationkey);
Comments
Post a Comment