added a not about using several directories for the filesystem loader
authorfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Mon, 28 Dec 2009 20:55:27 +0000 (20:55 +0000)
committerfabien <fabien@93ef8e89-cb99-4229-a87c-7fa0fa45744b>
Mon, 28 Dec 2009 20:55:27 +0000 (20:55 +0000)
git-svn-id: http://svn.twig-project.org/trunk@207 93ef8e89-cb99-4229-a87c-7fa0fa45744b

doc/03-Twig-for-Developers.markdown

index c6742d8..b5c43d8 100644 (file)
@@ -135,6 +135,15 @@ Here a list of the built-in loaders Twig provides:
         [php]
         $loader = new Twig_Loader_Filesystem($templateDir);
 
+   It can also look for templates in an array of directories:
+
+        [php]
+        $loader = new Twig_Loader_Filesystem(array($templateDir1, $templateDir2));
+
+   With such a configuration, Twig will first look for templates in
+   `$templateDir1` and if they do not exist, it will fallback to look for them
+   in the `$templateDir2`.
+
  * `Twig_Loader_String`: Loads templates from a string. It's a dummy loader as
    you pass it the source code directly.