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.

Customising the CMS /

modify save function


Reply


5 Posts   1357 Views

Avatar
bebabeba

Community Member, 192 Posts

15 September 2010 at 2:49am

Edited: 15/09/2010 2:55am

Hi!
I need modify save function: when I save a page in my CMS area, I need add a row in a new table of my db
Can you explain me where is save function? What's file name? where the exact poin?

Thanks!

Avatar
Willr

Forum Moderator, 5513 Posts

15 September 2010 at 11:52pm

The cleanest way to do this is to modify the onBeforeWrite (or on after write action of your page). http://doc.silverstripe.org/datamodel#onbeforewrite

Avatar
frankmullenger

Forum Moderator, 51 Posts

17 November 2010 at 5:34pm

How do you access the data from the form in onBeforeWrite? The form fields are custom and not saved in the record for the Page, but I just want to access the Form data itself and insert some rows into the DB based on that form data.

Avatar
BenWu

Community Member, 90 Posts

21 July 2012 at 2:14am

I would like to know as well.

for now i just use the $_POST to get form values, but it doesn't look like SS way

Avatar
gshegosh81

Community Member, 10 Posts

14 August 2012 at 7:14am

$this->record seems to be an array of the stuff from the form in onAfterWrite.