21287 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 490 Views |
-
Simple Page_Controler Function giving 404?

11 June 2010 at 7:46am
Hi all
in my /mysite/code/page.php
i haveclass Page_Controller extends ContentController {
public function MobileOff(){
$_SESSION['mobilePhone']="None";
Director::redirect(Director::baseURL().$this->URLSegment);
}
but when I navigate to site.com/MobileOff it gives me a page cannot be found.
What am I missing?
John -
Re: Simple Page_Controler Function giving 404?

11 June 2010 at 7:28pm
Well because out of the box the URL rules will match that to a Page. To do that you would have to use the url
site.com/home/MobileOff
And make sure its an allowed action. http://doc.silverstripe.org/security#security_in_controllers
| 490 Views | ||
|
Page:
1
|
Go to Top |


