...
|
...
|
@@ -148,18 +148,19 @@ methods::
|
148
|
148
|
$loader->addPath($templateDir3);
|
149
|
149
|
$loader->prependPath($templateDir4);
|
150
|
150
|
|
151
|
|
-The filesystem loader also supports namespaced templates. This allows to
|
152
|
|
-divide your templates in different namespaces; each namespace having its own
|
153
|
|
-template paths. Namespaced templates can be accessed via the special
|
154
|
|
-``@namespace_name/template_path`` notation::
|
|
151
|
+The filesystem loader also supports namespaced templates. This allows to group
|
|
152
|
+your templates under different namespaces which have their own template paths.
|
|
153
|
+
|
|
154
|
+When using the ``setPaths()``, ``addPath()``, and ``prependPath()`` methods,
|
|
155
|
+specify the namespace as the second argument (when not specified, these
|
|
156
|
+methods act on the "main" namespace)::
|
155
|
157
|
|
156
|
158
|
$loader->addPath($templateDir, 'admin');
|
157
|
159
|
|
158
|
|
- $twig->render('@admin/index.html', array());
|
|
160
|
+Namespaced templates can be accessed via the special
|
|
161
|
+``@namespace_name/template_path`` notation::
|
159
|
162
|
|
160
|
|
-The ``setPaths()``, ``addPath()``, and ``prependPath()`` methods all takes a
|
161
|
|
-namespace as an optional second argument; when not specified, these methods
|
162
|
|
-work on the "main" namespace.
|
|
163
|
+ $twig->render('@admin/index.html', array());
|
163
|
164
|
|
164
|
165
|
``Twig_Loader_String``
|
165
|
166
|
......................
|