mdcroke1
(Mark Croke)
February 3, 2011, 11:09pm
1
Hi all,
I am having an issue trying to use the CUrlManager. This is my first time attempting to use it, so if I am just being an idiot, please be gentle.
I have a kind of unusual set up to my website, such that the urls are like
/index.php?r=site/page&view=portfolio.overview
this page would be listed under /views/site/pages/portfolio/overview
I have tried setting up the main.config file to
'urlManager'=>array(
'showScriptName'=>false,
'urlFormat'=>'path',
'rules'=>array(
'<controller>/<view>'=>'<controller>/<view>',
'<controller>/<view>'=>'<controller>.<view>',
),
),
and used
$this->createUrl($_REQUEST['view'])
and a few other variations. So far, nothing but errors and page not founds to show.
Any thoughts or suggestions will be appreciated.
npCoda
(Sh Humble)
February 4, 2011, 5:24am
2
Hi all,
I am having an issue trying to use the CUrlManager. This is my first time attempting to use it, so if I am just being an idiot, please be gentle.
I have a kind of unusual set up to my website, such that the urls are like
/index.php?r=site/page&view=portfolio.overview
this page would be listed under /views/site/pages/portfolio/overview
I have tried setting up the main.config file to
'urlManager'=>array(
'showScriptName'=>false,
'urlFormat'=>'path',
'rules'=>array(
'<controller>/<view>'=>'<controller>/<view>',
'<controller>/<view>'=>'<controller>.<view>',
),
),
and used
$this->createUrl($_REQUEST['view'])
and a few other variations. So far, nothing but errors and page not founds to show.
Any thoughts or suggestions will be appreciated.
Try this in config/main.php
//// uncomment the following to enable URLs in path-format
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
mdcroke1
(Mark Croke)
February 4, 2011, 7:28pm
3
Coda,
Thanks for the suggestion. Unfortunately it didn’t seem to do the trick. Thanks for the ideas though. I may try re working the setup of my website to make it more “standard” and easier to integrate with the urlManager