Replies: 1 comment 2 replies
-
|
There are two primary options. If the public information isn't dependent on the content of the page, you can inject it as a custom function directly into the templating engine, otherwise you could wrap it into a struct (as long as it implements Serialize, you can pass it as a single parameter to context!). |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In the application I am writing I need to store both private API keys of external sites (E.g. sendgrid to send out emails) and public information as well (eg. the Google analytics code I need to include in every page.) I'd need to pass the public values to
Template::renderbut I think it would be better not to pass the private values to avoid accidentally publishing them.I could include pass the individual public values to each call of
Template::renderbut as the number of these public configuration values might grow it would not be nice to pass the same 2-3.. parameters to every function.How would you solve this?
Beta Was this translation helpful? Give feedback.
All reactions