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.

Customising the CMS /

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

How to retrieve value from SiteConfig


Go to End


3 Posts   1744 Views

Avatar
tbilyn

Community Member, 9 Posts

8 December 2010 at 2:38am

I have extended SiteConfig and add new field HREmail.
How to retrieve value from this field in code, not in template?

Avatar
bummzack

Community Member, 904 Posts

8 December 2010 at 4:19am

Edited: 08/12/2010 4:20am

You could use:

$config = SiteConfig::current_site_config();
// do something here, eg. $config->HREmail;

Avatar
tbilyn

Community Member, 9 Posts

8 December 2010 at 5:23am

Thanks, banal