WEBVTT 00:00.330 --> 00:04.800 You've just seen how we can use templates, but what about adding some more functionality? 00:05.220 --> 00:09.690 What if we had something we want to enable in certain environments, but not in others? 00:10.080 --> 00:12.110 It'd be quite messy to keep it in the code. 00:12.660 --> 00:15.090 So another great way of doing this is with templates. 00:15.610 --> 00:18.330 But as you see, we're not just limited to a single line. 00:18.330 --> 00:20.010 We can have entire things in there. 00:20.340 --> 00:25.320 Now, one of the examples with one of the clients I work with is they had a particular proxy that needed 00:25.320 --> 00:30.630 to be enabled in certain environments, soroban, and keep it in the code and having everything inside 00:30.630 --> 00:35.460 of John F block statement, which would then look messy and it would mean you'd have to maintain it 00:35.460 --> 00:42.180 by putting it into a template file and having a simple if statement were to enable it or not, inside 00:42.180 --> 00:44.070 the values file for each environments. 00:44.410 --> 00:47.940 It was a really efficient way of including the code. 00:48.210 --> 00:50.400 So let's go ahead and set that up ourselves. 00:51.190 --> 00:57.960 If we go to our templates, we're going to create a new file and we're going to call it underscore proxy 00:58.380 --> 00:59.730 DOT TPL. 01:00.840 --> 01:03.360 And inside what we get to do is copy paste code here. 01:06.090 --> 01:11.460 But first, we need to set up a template, so to do that, double calibrates. 01:12.480 --> 01:13.200 To Duchies. 01:15.030 --> 01:18.720 I'm going to put define double quotes proxy. 01:21.080 --> 01:26.720 But again, we need to put an end statement here so that he'll know where it stops and how we post in 01:26.720 --> 01:27.170 our code. 01:27.980 --> 01:30.410 Now comes the important bit of indenting. 01:31.550 --> 01:35.960 If you're wondering how I'm selecting multiple lines here on a Mac, I'm holding down option. 01:37.420 --> 01:39.720 So let's bring that over and let's sort this out. 01:41.990 --> 01:43.550 I'm gonna call this proxy. 01:44.810 --> 01:50.540 And we'll leave it like that again and a real life situation, you might call with something else and 01:50.540 --> 01:55.760 again, you might be using a different image now, but we've gone ahead and defined our proxy. 01:56.150 --> 02:01.820 Let me show you how you can use if statements and how and how it's going to set your templates and add 02:01.820 --> 02:03.590 even more functionality.