From: nikic <+@ni-po.com> Date: Thu, 23 Dec 2010 10:26:09 +0000 (+0100) Subject: update Core Extension doc X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=522f35ed6bf56fbcd7243836310d89027fc982f9;p=web%2Fkonrad%2Ftwig.git update Core Extension doc --- diff --git a/doc/api.rst b/doc/api.rst index 92eeafc..c3e6a47 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -224,15 +224,14 @@ is still fresh, given the last modification time, or ``false`` otherwise. Using Extensions ---------------- -Twig extensions are packages that adds new features to Twig. Using an +Twig extensions are packages that add new features to Twig. Using an extension is as simple as using the ``addExtension()`` method:: $twig->addExtension(new Twig_Extension_Sandbox()); Twig comes bundled with the following extensions: -* *Twig_Extension_Core*: Defines all the core features of Twig and is - automatically registered when you create a new environment. +* *Twig_Extension_Core*: Defines all the core features of Twig. * *Twig_Extension_Escaper*: Adds automatic output-escaping and the possibility to escape/unescape blocks of code. @@ -276,15 +275,17 @@ The ``core`` extension defines all the core features of Twig: * ``filter`` * ``macro`` * ``import`` + * ``from`` * ``set`` + * ``spaceless`` * Filters: * ``date`` * ``format`` - * ``even`` - * ``odd`` - * ``urlencode`` + * ``replace`` + * ``url_encode`` + * ``json_encode`` * ``title`` * ``capitalize`` * ``upper`` @@ -294,15 +295,29 @@ The ``core`` extension defines all the core features of Twig: * ``reverse`` * ``length`` * ``sort`` - * ``in`` - * ``range`` - * ``cycle`` + * ``merge`` * ``default`` * ``keys`` - * ``items`` * ``escape`` * ``e`` +* Functions: + + * ``range`` + * ``constant`` + * ``cycle`` + +* Tests: + + * ``even`` + * ``odd`` + * ``defined`` + * ``sameas`` + * ``none`` + * ``divisibleby`` + * ``constant`` + * ``empty`` + Escaper Extension ~~~~~~~~~~~~~~~~~