December 2018
Beginner to intermediate
796 pages
19h 54m
English
A common question among beginners is how to perform numeric computations such as finding percentages in templates. As a design philosophy, the template system does not intentionally allow the following:
This decision was made to prevent you from adding business logic in templates. From my experience with PHP or ASP-like languages, mixing logic with presentation can be a maintenance nightmare. However, you can write custom template tags (which will be covered shortly) to perform any computation, especially if it is presentation-related.
Keep business logic out of your templates.
Despite this advice, some prefer ...
Read now
Unlock full access