Jump to content
Larry Ullman's Book Forums

Verify Using Routes

Recommended Posts

I tried to use the Verify route from the book.


'verify/<x:\w+>/<y:\w+>' => 'user/verify',


i added a verify action to my user controller,


public function actionVerify($x, $y)




i will be passing an email and activation code to it.




however when i tested it i receive this message:


Error 404
Unable to resolve the request "verify/email@gmail.com/1d2860f7df".
Does anyone know what i am doing wrong?


Link to post
Share on other sites

The @ doesn't match a word. Apologies if that was my fault. You'll need to change the "x" match to allow for that, and the period, and anything else that could be in a email address. Let me know if you need help in doing that.

Link to post
Share on other sites

Thanks Larry and Jonathon, i changed mine to


'verify/<x:.+>/<y:\w+>' => 'user/verify',


and now it works, i prefer to use the + over * as there has to be more than 1 character i guess it doesn't matter and comes down to your own personal preference.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...