Jump to content
Larry Ullman's Book Forums

Verify Using Routes


Edward
 Share

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.

 

http://localhost/myyiisite/verify/email%40gmail.com/1d2860f7df

 

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 comment
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 comment
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 comment
Share on other sites

 Share

×
×
  • Create New...