Sub-templates do not exist as such in the templating system.
The fact is that you can include sub-templates into a main template, which is not a rare process. Some frameworks, not only in haXe, have even made this standard behavior.
So, there are two ways of doing this:
- Execute the sub-template, store its return value, and pass it as a property to the main template when executing it.
- Create a macro to execute the sub-template and return its value. This way you just have to call the macro whenever you want to include your sub-template in your main template.