Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

the method 'setsession' does not exist on 'MyClass'


Go to End


2 Posts   1089 Views

Avatar
Praveen

Community Member, 49 Posts

6 April 2015 at 6:35pm

Edited: 06/04/2015 7:08pm

I am getting error when I add rule

//Config
Director::addRules(100, array(
    'mypage/profile//$Action/$ID' => MyClass',
    'mypage/profile//' => 'MyClass'
));

//MyClass Controller
class MyClass_Controller extends Page_Controller 
	private static $allowed_actions = array (
		'index',
		'view',
	);
}

Thanks
B L Praveen

Avatar
Praveen

Community Member, 49 Posts

6 April 2015 at 7:20pm

Edited: 06/04/2015 7:29pm

Sorry,I made a mistake in the config file it should redirect to the mycalss controller.

Director::addRules(100, array(
    'mypage/profile//$Action/$ID' => 'MyClass_Controller',
    'mypage/profile//' => 'MyClass_Controller'
));

On Redirect not able to access the method of Controller DataObjects

MyClass  extends Page  {
public function getModulePath() {
}
}
class MyClass_Controller extends Page_Controller {
public function init()
	{
                Requirements::css($this->getModulePath() ."/css/myclass-style.css");
       }
}