3

im trying create url like this: www.domain.com/auth?join=social in yii. This is my config:

'urlManager' => array(
    'urlFormat' => 'path',
     'rules' => array(
        '<action:(auth)>' => 'site/<action>',
        '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
     ),
     'showScriptName'=>false,
), 

when i calling this: www.domain.com/auth?join=social page i cant get param: join. But when i calling www.domain.com/index.php/auth?join=social i can get. im getting param with this code: $social = Yii::app()->request->getParam('join');. Where is my error?

3 Answers 3

5
$social = Yii::app()->request->getParam('social');

change it with

$social = Yii::app()->request->getParam('join');
Sign up to request clarification or add additional context in comments.

3 Comments

Ups its my error. In my code was join. When i wrote this question than i wrote incorrect. Okay its not problem im using lighty maybe there something wrong? what do you think?
I dont know but maybe '<action:(auth)>' => 'site/<action:\w+>', will fix the problem. Can you try this.
Burhan Çetin thank you to your answers. I found my error. Im using lighty server. there are not works htaccess file. and i configure url.rewrite and it works. Teşekkür ederim!
1

I find my error it wasnt error YII. I must be write rewrite rules in lighttpd configurations. Here explained very well. Thanks!

Comments

0

try

$_REQUEST['join']

in your action.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.