You have been redirected from an outdated version of the article. Below is the content available on this topic. To view the old article click here.

config()

Usage

config(key[, default])

Description
Returns the configuration value associated with the given key from structr.conf. This method can be used to read arbitrary values(*) from the configuration file and use it to configure frontend behaviour, default values etc. The optional second parameter is the default value to be returned if the configuration key is not present.

* For security purposes the superuser password can not be read with this function.

Example

${config('files.path')}
${config('some.unconfigured.key', 'default value')}

results in

./files
default value

Search results for "config()"

config()

Returns the configuration value associated with the given key from structr.conf. This method can be used to read arbitrary values from the configuration file and use it to configure frontend behaviour, default values etc. The optional second parameter is the default value to be returned if the configuration key is not present.

config(key[, default])

mail_select_config()

Allows selecting a different SMTP configuration (as configured in structr.conf) for the current outgoing mail. The 6 SMTP settings can be overridden individually by adding a prefixed configuration entry. If no entry is found the default (non-prefixed) value is used.

mail_select_config(name)

mail_set_manual_config()

New in v3.6: Allows setting completely manual/dynamic SMTP configuration for the current outgoing mail.

mail_set_manual_config(smtpHost = 'localhost', smtpPort = 25, smtpUser = null, smtpPassword = null, smtpUseTLS = true, smtpRequireTLS = true)

mail_reset_manual_config()

New in v3.6: Allows resetting a previously set manual/dynamic SMTP configuration for the current outgoing mail.

mail_reset_manual_config()