From 9a7b58654815a2d3729e3b83ec7b99ed261fcaee Mon Sep 17 00:00:00 2001 From: Patrick Louys Date: Wed, 2 Nov 2016 13:03:57 +0100 Subject: [PATCH] Update 11-page-menu.md --- 11-page-menu.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/11-page-menu.md b/11-page-menu.md index 3e793e3..6490067 100644 --- a/11-page-menu.md +++ b/11-page-menu.md @@ -2,17 +2,17 @@ ### Page Menu -Now we have some sweet dynamic pages. But nobody can find them. +Now we have made a few nice dynamic pages. But nobody can find them. -Let's fix that now. In this chapter we will create a menu with links to all our pages. +Let's fix that now. In this chapter we will create a menu with links to all of our pages. -When we have a menu, we will want to be able to reuse the same code on multiple page. We could create a separate file and include it every time, but there is a better solution. +When we have a menu, we will want to be able to reuse the same code on multiple pages. We could create a separate file and include it every time, but there is a better solution. It is more practical to have templates that are able to extend other templates, like a layout for example. Then we can have all the layout related code in a single file and we don't have to include header and footer files in every template. -Sadly our implementation of mustache does not support this. We could write code to work around this, which will take time and could introduce some bugs. Or we could switch to a library that already supports this and is well tested. [Twig](http://twig.sensiolabs.org/) for example. +Our implementation of mustache does not support this. We could write code to work around this, which will take time and could introduce some bugs. Or we could switch to a library that already supports this and is well tested. [Twig](http://twig.sensiolabs.org/) for example. -Now you might wonder why we didn't start with Twig right away. This is a good example to show why using interfaces and writing loosely-coupled code is a good idea. +Now you might wonder why we didn't start with Twig right away. Because this is a good example to show why using interfaces and writing loosely-coupled code is a good idea. Like in the real world, the requirements suddenly changed and now our code needs to adapt. Remember how you created a `MustacheRenderer` in [chapter 9](09-templating.md)? This time, we create a `TwigRenderer` that implements the same interface.