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.

All other Modules /

Discuss all other Modules here.

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

UserForms as an extension (using DataObjectDecorator)


Go to End


2 Posts   1610 Views

Avatar
ohm

Community Member, 3 Posts

11 December 2009 at 10:32am

the suggestion in the title might not be the best solution though... here's what I'm trying to do:

I want to add a userform to an already existing pagetype, that already sits comfortably in my class hierarchy, so inheriting from UserDefinedForm is not ideal.

Any other way to put a user defined form on that page? Using DataObjectDecorator would mean rewriting UserDefinedForm or wrapping it in a DataObjectDecorator somehow...

thanks

Avatar
Willr

Forum Moderator, 5523 Posts

11 December 2009 at 8:16pm

Interesting thought, hadn't thought of making a decorator. UserDefinedForm.php does contain alot of custom code so not sure if you're going to run into issues round the form submission process but to be honest I think most of it should work fine as a decorator (Haven't tested decorators with forms).

Give it a go rewriting it as a decorator and let me know how far you get. Might be interested in seeing what issues you have and if they can resolved and redo the module core for it because you're quite correct - it would make the page type alot more flexible.