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

Which shold be the basic code to extend Userforms?


Go to End


3 Posts   1855 Views

Avatar
ShaggyStyle

Community Member, 7 Posts

11 February 2010 at 1:33pm

Edited: 11/02/2010 1:34pm

I need to have different templates for diferent userforms... so the only way that I see is extending the userdefinedform class...

As I see the next code is not enought.

<?php 
class UserDefinedFormTienda extends UserDefinedForm {

}


class UserDefinedFormTienda_Controller extends Page_Controller {


	}

}
?>

Any idea please?

Avatar
bummzack

Community Member, 904 Posts

11 February 2010 at 8:23pm

Hi

It should be

<?php
class UserDefinedFormTienda extends UserDefinedForm {

}

class UserDefinedFormTienda_Controller extends UserDefinedForm_Controller {

}

In addition you had a spare closing bracket at the bottom of your code...

After creating the file, don't forget to run dev/build

Avatar
ShaggyStyle

Community Member, 7 Posts

12 February 2010 at 4:35am

What a fool of me!!! I didn't noticed this detail. Thanks a lot