UrlManager question

In my urlmanager I got:


This works fine, but now I want to do something similar where the first parameter is an activationkey and the second an email adress.

I came up with this but it doesn’t seem to work:


The only reason I can think of why this doesn’t work is that the activation key is made up from letters and numbers, but not entirly sure how to write that in the urlmanager. I read this about URL’s but most examples are with digits, or just plain strings, not a mixture of them.

What I get now if I enter a hyperlink like:


I get an error that says: "Unable to resolve the request".

entire urlmanager:






















Haven’t tested but this should work


From the Definitive guide to Yii:


where ParamName specifies the name of a GET parameter, and the optionalParamPattern specifies the regular expression that should be used tomatch the value of the GET parameter. In case when ParamPattern is omitted,it means the parameter should match any characters except the slash /.

use \w\d+

You need to explore Regular Expressions:

try to test:

var_dump(preg_match('/\w+/', 'email@test.nl')); // <email:\w+>

but pattern




) will help you

Thanks, problem solved

‘activation/<activkey:>/<email:>’ did the trick.

Yea and it will accept any parameters. You should use some rules to limit the parameters it allows.