In the previous recipe, we saw how to use XTemplate
, but did not utilize its capabilities such as using auto-filling arrays, conditional processing, math function, and so on to build the view by making different decisions on the incoming data. For example, in the previous recipe, we are showing all kinds of flowers in our view. What if we just want to show roses? This is where XTemplate
helps us to put the constructs inside the template definition and not make any change to the data.
Make sure that you have set up your development environment by following the recipes outlined in Chapter 1.