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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Form Questions /

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

How to bind data source on the forms in Silverstripe

Go to End

3 Posts   1049 Views


Community Member, 25 Posts

10 April 2012 at 10:22am

As per titular heading, I'm wondering if there's any sample code out there in community that allows me to bind data source on the form's fields?

I'm sure this is a very common task when building any database-driven websites and I'm curious how I can manipulate modules like UDF to save the fields' data into a table?


Forum Moderator, 5523 Posts

11 April 2012 at 7:18pm

You can bind data sources to regular forms quite easily ($form->loadDataFrom($obj); $form->saveInto($obj)) but UDF hasn't been designed to support those sort of options yet.

Some basic hooks [1] are available to developers to add on their own extensions to load without hacking core but at the moment support for custom actions is minor.


If you want to save data you could put an extension and tie into the onAfterWrite function of SubmittedForm.


Community Member, 25 Posts

17 April 2012 at 10:46am

HI @Willr,

Thanks for the help.

I tried the link below. Got a 404 error.

Can you show me the correct link again?