I am new to php, new to mvc, new to yii, and new to url-rewriting. So, I am sorry, if I am asking something very basic.
I have hide the index.php (from the htaccess method discussed in forums)
In my urlmanager, I have this,
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>'
),
'showScriptName'=>false,
I have 3 files in view/site folder.
-
‘journey’,
-
‘invite’,
-
‘linkedin’.
Now, my home page should redirect to ‘journey’ action (i.e. should open the ‘site/journey.php’)
So, I guess, this would be
'/' => 'site/journey'
. It works too.
Now, I want ‘journey/invite’ should invoke the ‘invite’ action i.e. should open ‘site/invite.php’
And, ‘journey/linkedin’ should invoke the ‘linkedin’ action i.e. ‘site/linkedin.php’.
but,
'journey/invite' => 'site/invite',
'journey/linkedin' => 'site/linkedin'
is not working.
Also, can someone help me understand these
<controller:\w+>/<id:\d+>
i.e. what is controller in url and what does ‘w+’ mean ?
A reference to guide will help too.