From 942607245cdf81d5ced98c8eb10ce5c2a90d1730 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Tue, 17 Jul 2012 08:23:45 +0200 Subject: [PATCH] tweaked documentation --- doc/api.rst | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 1f8e1fc..d348fb2 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -148,18 +148,19 @@ methods:: $loader->addPath($templateDir3); $loader->prependPath($templateDir4); -The filesystem loader also supports namespaced templates. This allows to -divide your templates in different namespaces; each namespace having its own -template paths. Namespaced templates can be accessed via the special -``@namespace_name/template_path`` notation:: +The filesystem loader also supports namespaced templates. This allows to group +your templates under different namespaces which have their own template paths. + +When using the ``setPaths()``, ``addPath()``, and ``prependPath()`` methods, +specify the namespace as the second argument (when not specified, these +methods act on the "main" namespace):: $loader->addPath($templateDir, 'admin'); - $twig->render('@admin/index.html', array()); +Namespaced templates can be accessed via the special +``@namespace_name/template_path`` notation:: -The ``setPaths()``, ``addPath()``, and ``prependPath()`` methods all takes a -namespace as an optional second argument; when not specified, these methods -work on the "main" namespace. + $twig->render('@admin/index.html', array()); ``Twig_Loader_String`` ...................... -- 1.7.2.5