As soon as I pass 41 at the URL. confirm.php fingerprints 41.
http: // localhost / yii2-app-basic / web / site / confirm / 41
But, when I pass "cfeb70c4c627167ee56d6e09b591a3ee" or "41a" to the URL,
http: // localhost / yii2-app-basic / web / site / confirm / 41a
error displayed
NOT FOUND (# 404)
Page not found.
The above error occurred while the web server was processing your request. Please contact us if you think this is a server error. Thanks.
I want to send a verification ID to the user in order to verify my account. That is why the random number "cfeb70c4c627167ee56d6e09b591a3ee" is transmitted.
So what can I do to make the url accept an alpha numeric parameter.
config /web.php
'urlManager' => [ 'showScriptName' => false, 'enablePrettyUrl' => true, 'enableStrictParsing' => false, 'rules' => [ '<controller>/<action>/<id:\d+>' => '<controller>/<action>' ], ],
SiteController.php
public function actionConfirm($id) { $id = Yii::$app->request->get('id'); $this->view->params['customParam'] = $id; return $this->render("confirm",array("id"=>$id)); }
source share