You've just seen how we can use templates, but what about adding some more functionality?
What if we had something we want to enable in certain environments, but not in others?
It'd be quite messy to keep it in the code.
So another great way of doing this is with templates.
But as you see, we're not just limited to a single line.
We can have entire things in there.
Now, one of the examples with one of the clients I work with is they had a particular proxy that needed
to be enabled in certain environments, soroban, and keep it in the code and having everything inside
of John F block statement, which would then look messy and it would mean you'd have to maintain it
by putting it into a template file and having a simple if statement were to enable it or not, inside
the values file for each environments.
It was a really efficient way of including the code.
So let's go ahead and set that up ourselves.
If we go to our templates, we're going to create a new file and we're going to call it underscore proxy
DOT TPL.
And inside what we get to do is copy paste code here.
But first, we need to set up a template, so to do that, double calibrates.
To Duchies.
I'm going to put define double quotes proxy.
But again, we need to put an end statement here so that he'll know where it stops and how we post in
our code.
Now comes the important bit of indenting.
If you're wondering how I'm selecting multiple lines here on a Mac, I'm holding down option.
So let's bring that over and let's sort this out.
I'm gonna call this proxy.
And we'll leave it like that again and a real life situation, you might call with something else and
again, you might be using a different image now, but we've gone ahead and defined our proxy.
Let me show you how you can use if statements and how and how it's going to set your templates and add
even more functionality.