<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Global Variables | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/global-variables/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Mon, 12 Sep 2011 10:24:57 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>[Symfony 2] Twig &#8211; Global Variables</title>
		<link>https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/</link>
					<comments>https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Mon, 12 Sep 2011 10:21:22 +0000</pubDate>
				<category><![CDATA[API]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Global Variables]]></category>
		<category><![CDATA[symfony 2]]></category>
		<category><![CDATA[Twig]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1647</guid>

					<description><![CDATA[<p>Schon mal gefragt, welche globalen Variablen in der Twig-Extension eines Symfony 2 (Standard Distri)-Projektes zur Verfügung stehen? Schaut man sich die Klasse GlobalVariables im Namespace Symfony\Bundle\FrameworkBundle\Templating an (diese Klasse ist Teil des Framework-Bundles, d.h., Gleiches gilt ebenfalls für PHP als Template-Maschine), wird einiges klarer. Weiter unten eine Liste der Assessoren, die die Klasse bereitstellt: In &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/" class="more-link">Continue reading<span class="screen-reader-text"> "[Symfony 2] Twig &#8211; Global Variables"</span></a></p>
The post <a href="https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/">[Symfony 2] Twig – Global Variables</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Schon mal gefragt, welche globalen Variablen in der Twig-Extension eines Symfony 2 (Standard Distri)-Projektes zur Verfügung stehen?<span id="more-1647"></span><br />
Schaut man sich die Klasse GlobalVariables im Namespace Symfony\Bundle\FrameworkBundle\Templating an (diese Klasse ist Teil des Framework-Bundles, d.h., Gleiches gilt ebenfalls für PHP als Template-Maschine), wird einiges klarer. Weiter unten eine Liste der Assessoren, die die Klasse bereitstellt:</p>
<pre class="brush: bash; title: ; notranslate">
    Symfony\Component\Security\Core\SecurityContext|void         getSecurity()
    Symfony\Component\Security\Core\User\(Advanced)UserInterface getUser()
    Symfony\Component\HttpFoundation\Request|void                getRequest()
    Symfony\Component\HttpFoundation\Session|void                getSession()
    string                                                       getEnvironment()
    bool                                                         getDebug()</pre>
<p>In Twig liegt der Container im &#8220;app&#8221;-Namespace, &#8220;Übersetzt&#8221; nach Twig heißt das ganze also:</p>
<pre class="brush: bash; title: ; notranslate">
    app.security
    app.user
    app.request
    app.session
    app.environment
    app.debug
</pre>
<p>Viel Spaß beim Templates-Bauen ;)</p>The post <a href="https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/">[Symfony 2] Twig – Global Variables</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
