Custom config in cake.config

271 Views Asked by At

Cake supports configuration in a cake.config file.

Can I read my own config key/values from that file?

1

There are 1 best solutions below

3
lonix On BEST ANSWER

Cake has a method to retrieve those values.

Example:

cake.config

[MyCustomConfig]
Foo=Bar

build.cake

Information(Context.Configuration.GetValue("MyCustomConfig_Foo"));   // Bar

(Note the underscore "_" - it isn't documented, so I hope it's reliable.)