Improve to the templating section

Add inheritance examples
Add the word "partials" to better describe reusable pieces of code
Clarify the role of templates (views) in the MVC pattern
Add note of caution around Smarty auto escaping
This commit is contained in:
Jonathan Reinink
2014-08-15 13:53:45 -04:00
parent 90cdf53611
commit d6f59a1ce0
4 changed files with 81 additions and 6 deletions

View File

@@ -13,8 +13,8 @@ the client-side code (markup).
Templates also improve the organization of presentation code. Templates are typically placed in a "views" folder, each
defined within a single file. This approach encourages code reuse where larger blocks of code are broken into smaller,
reusable pieces. For example, your site header and footer can each be defined as templates, which are then included
before and after each page template.
reusable pieces, often called partials. For example, your site header and footer can each be defined as templates,
which are then included before and after each page template.
Finally, depending on the library you use, templates can offer more security by automatically escaping user-generated
content. Some libraries even offer sand-boxing, where template designers are only given access to white-listed