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.

Data Model Questions /

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

RestfulServer and custom classes?


Go to End


2 Posts   2296 Views

Avatar
Mange

Community Member, 3 Posts

29 April 2009 at 2:31am

Edited: 29/04/2009 2:32am

Hello!

I'm experimenting with the restfulserver (http://doc.silverstripe.org/doku.php?id=restfulserver) to manipulate the "Member" object and I think it would be useful for my project, however I'd like to avoid any modifications to the actual SS core files and keep my changes to code in "mysite".

Is this possible?

regards,
Mange

Avatar
Ingo

Forum Moderator, 801 Posts

11 May 2009 at 8:32pm

You can subclass RestfulServer and use custom routing:

Director::addRules(100, array(
	'api/v1//Member => 'CustomMemberRestfulServer'
));

For adding properties to the built-in Member class, read up about DataObjectDecorator :)