How To Get Var From Seo Url?


In urlManager:


now if the url :


How to get the $t ??


In your /protected/config/main.php if you had something like this:

      'urlManager' => array(

        'urlFormat' => 'path',

        'showScriptName' => false,

        'rules' => array(

          'user/passwordreset/t/<someString:\w+>' => 'user/passwordReset/'


In this example if we have the URL : user/passwordreset/t/asdagfasgas

Inside UserController have a function



The variable which could only be 1 or characters would be placed inside $_GET[‘someString’] which would be understood by actionPasswordReset as the $someString variable to be used in the function.

You could make this more dynamic and less specific then I did but it should work.

Thanks alot ;)