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

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -