Ismael
(Shalanga)
June 22, 2009, 10:32pm
1
Hi all.
I have an action in url named "saiba-mais" with minus between words.
I get this error: Page Not Found
The system is unable to find the requested action "saiba-mais".
Well, Shouldn't the controller able to see my method?
public function actionSaibaMais() {}
I tried to use __call() method to intercept this missing action and forward to the right method, but this __call method isn't even called.
For SEO issues, I need to call the action "saiba-mais" and no other option.
I'd like to solve this without creating a router rule for this.
Can someone help me? Oo'
Thks!
wei
(Weizhuo)
June 23, 2009, 1:28am
2
qiang
(Qiang Xue)
June 23, 2009, 1:30am
3
An alternative approach is to override CUrlManager::parseUrl()
public function parseUrl($request)
{
$route=parent::parseUrl($request);
...transform $route based on your criteria...
return ..transformed $route...
}
Ismael
(Shalanga)
June 23, 2009, 8:33pm
4
Thank you Both!
Maybe this issue should be in guide. Or an advanced guide.
mbi
(mbi)
June 24, 2009, 2:42pm
5
For SEO issues, why not creating a route?
It seems, saiba-mais is more a sluggefied identifier than an action
Ismael
(Shalanga)
June 24, 2009, 2:59pm
6
Because I don't want to create a route just because I have only one method with this specific name.
In teory, the Yii framework should apply some Inflector method to translate to proper method name. Like, “come-on” shoud look action name “ComeOn”, depending on rule translation.