0

I want to get value of a key defined in beego's app.conf and render in html pages. As per documentation on http://beego.me/docs/mvc/view/template.md I can get value of AppConfig by using config function in templates. However there is no example in documentation.

Get the value of AppConfig. {{config configType configKey defaultValue}}. configType must be String, Bool, Int, Int64, Float, or DIY

After trying many ways I came to this:

<div>{{config config.String config.appname "TestDefaultValue"}}</div>

But I am always getting error:

<config>: wrong number of args for config: want 3 got 0

What is the correct way to use config template function?

Reekdeb Mal
  • 728
  • 1
  • 7
  • 13

1 Answers1

0

Finally I solved this myself. config template function accepts all parameters as string.

Correct way to use config template function is:

<div>{{config "String" "appname" "TestDefaultValue"}}</div>
Reekdeb Mal
  • 728
  • 1
  • 7
  • 13