``$templateDir1`` and if they do not exist, it will fallback to look for them
in the ``$templateDir2``.
+You can add or prepend paths via the ``addPath()`` and ``prependPath()``
+methods::
+
+ $loader->addPath($templateDir3);
+ $loader->prependPath($templateDir4);
+
``Twig_Loader_String``
......................
}
/**
+ * Prepends a path where templates are stored.
+ *
+ * @param string $path A path where to look for templates
+ */
+ public function prependPath($path)
+ {
+ // invalidate the cache
+ $this->cache = array();
+
+ if (!is_dir($path)) {
+ throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path));
+ }
+
+ array_unshift($this->paths, rtrim($path, '/\\'));
+ }
+
+ /**
* Gets the source code of a template, given its name.
*
* @param string $name The name of the template to load