Page 1 of 1

where are the module settings data saved? [solved]

Posted: Thu May 31, 2007 1:33 pm
by pumuklee
hi

i create a new module

i need also a settings tab for this to set some colours, names, email address...

the question is where are these data saved normally in cmsms
because for other modules i didnt find this datas in DB and nor in config files

so the question is where the settings saved?(DB, file...)

thanks

Re: where are the module settings data saved?

Posted: Thu May 31, 2007 1:43 pm
by calguy1000
We use the GetPreference and SetPreference api methods to store the module preferences, which does store the data in the preferences table.

Re: where are the module settings data saved?

Posted: Thu May 31, 2007 1:53 pm
by pumuklee
hi

i find something also

so that all the settings are saved in the cms_siteprefs table in the DB for all the modules
and if i need something i read it from this table?
and if i want to have some settings for a module than i create a new record in this table?
with the name and value which i want

thanks

Re: where are the module settings data saved?

Posted: Thu May 31, 2007 1:54 pm
by calguy1000
in a module I just call $this->SetPreference('preference_name',$value);  and to retrieve the preference $this->GetPreference('preference_name')

That's all you need to do.

Re: where are the module settings data saved?

Posted: Thu May 31, 2007 2:00 pm
by pumuklee
ok thanks
i do in this way