Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
c51b99bd
Commit
c51b99bd
authored
Aug 08, 2011
by
Igor Wiedler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[docs] adjust usage section of twig
parent
340b6ce2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
doc/extensions/twig.rst
doc/extensions/twig.rst
+11
-6
No files found.
doc/extensions/twig.rst
View file @
c51b99bd
...
@@ -68,11 +68,16 @@ The Twig extension provides a ``twig`` service.
...
@@ -68,11 +68,16 @@ The Twig extension provides a ``twig`` service.
This will render a file named ``views/hello.twig``.
This will render a file named ``views/hello.twig``.
It also registers the application as a global named
.. tip::
``app``. So you can access any services from within your
view. For example to access ``$app['request']->getHost()``,
just put this in your template:
.. code-block:: jinja
The TwigExtension also registers the application as a global
named ``app``. So you can access any services from within your
view. For example to access ``$app['request']->getHost()``,
just put this in your template:
.. code-block:: jinja
{{ app.request.host }}
{{ app.request.host }}
For more information, check out the `Twig documentation
<http://www.twig-project.org>`_.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment