<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: [Symfony 2] Twig &#8211; Global Variables	</title>
	<atom:link href="https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Mon, 23 Jul 2012 13:49:21 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: joshi		</title>
		<link>https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/#comment-17874</link>

		<dc:creator><![CDATA[joshi]]></dc:creator>
		<pubDate>Mon, 23 Jul 2012 13:49:21 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=1647#comment-17874</guid>

					<description><![CDATA[Indeed. The above article is not about how to inject new globals but how to identify existing ones - written in a time where there was only little documentation about twig integration into symfony (performed by twig bundle/twig bridge).

So please consider this post as outdated and refer to the official symfony templating documentation and related cookbook articles.

For myself i would always prefer writing a twig extension in favor of depositing globals into the &quot;twig&quot;-section of config.yml.]]></description>
			<content:encoded><![CDATA[<p>Indeed. The above article is not about how to inject new globals but how to identify existing ones &#8211; written in a time where there was only little documentation about twig integration into symfony (performed by twig bundle/twig bridge).</p>
<p>So please consider this post as outdated and refer to the official symfony templating documentation and related cookbook articles.</p>
<p>For myself i would always prefer writing a twig extension in favor of depositing globals into the &#8220;twig&#8221;-section of config.yml.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: david		</title>
		<link>https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/#comment-17872</link>

		<dc:creator><![CDATA[david]]></dc:creator>
		<pubDate>Mon, 23 Jul 2012 11:41:28 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=1647#comment-17872</guid>

					<description><![CDATA[as this is the first hit in google for &quot;symfony global twig&quot; i want to point out that the idea to hack GlobalVariables.php is a very ugly hack indeed, as you will lose things when you update symfony.

have a look at this cookbook entry how to do things properly:
http://symfony.com/doc/current/cookbook/templating/global_variables.html]]></description>
			<content:encoded><![CDATA[<p>as this is the first hit in google for &#8220;symfony global twig&#8221; i want to point out that the idea to hack GlobalVariables.php is a very ugly hack indeed, as you will lose things when you update symfony.</p>
<p>have a look at this cookbook entry how to do things properly:<br />
<a href="http://symfony.com/doc/current/cookbook/templating/global_variables.html" rel="nofollow ugc">http://symfony.com/doc/current/cookbook/templating/global_variables.html</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Adam Pugh		</title>
		<link>https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/#comment-6857</link>

		<dc:creator><![CDATA[Adam Pugh]]></dc:creator>
		<pubDate>Tue, 20 Dec 2011 18:08:20 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=1647#comment-6857</guid>

					<description><![CDATA[Once you find the GlobalVariables.php all you have to do is make functions inside that file (with the same naming conventions) and Symfony will Automagically allow the use of those functions inside of Twig.

Example:

	public function getHttp()
    {
        if ($request = $this-&#062;getRequest()) {
            return $request-&#062;getHttpHost();
        }
    }


use {{ app.http }} in your Twig]]></description>
			<content:encoded><![CDATA[<p>Once you find the GlobalVariables.php all you have to do is make functions inside that file (with the same naming conventions) and Symfony will Automagically allow the use of those functions inside of Twig.</p>
<p>Example:</p>
<p>	public function getHttp()<br />
    {<br />
        if ($request = $this-&gt;getRequest()) {<br />
            return $request-&gt;getHttpHost();<br />
        }<br />
    }</p>
<p>use {{ app.http }} in your Twig</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Matt Weisman		</title>
		<link>https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/#comment-2459</link>

		<dc:creator><![CDATA[Matt Weisman]]></dc:creator>
		<pubDate>Wed, 26 Oct 2011 18:18:22 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=1647#comment-2459</guid>

					<description><![CDATA[In the time you commented back to the first response, you could have translated this post :( 

Thanks for pointing out the GlobalVariables.php file though!]]></description>
			<content:encoded><![CDATA[<p>In the time you commented back to the first response, you could have translated this post :( </p>
<p>Thanks for pointing out the GlobalVariables.php file though!</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Johannes Heinen		</title>
		<link>https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/#comment-1461</link>

		<dc:creator><![CDATA[Johannes Heinen]]></dc:creator>
		<pubDate>Wed, 05 Oct 2011 08:20:52 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=1647#comment-1461</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/#comment-1460&quot;&gt;goyote&lt;/a&gt;.

The master of the internet told me to do so, but never reported back since then :(

Perhaps i decide to translate the article in the near future, in the meantime i suggest to investigate the contents of the class Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables which should make things clear.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/#comment-1460">goyote</a>.</p>
<p>The master of the internet told me to do so, but never reported back since then :(</p>
<p>Perhaps i decide to translate the article in the near future, in the meantime i suggest to investigate the contents of the class Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables which should make things clear.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: goyote		</title>
		<link>https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/#comment-1460</link>

		<dc:creator><![CDATA[goyote]]></dc:creator>
		<pubDate>Wed, 05 Oct 2011 07:28:50 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=1647#comment-1460</guid>

					<description><![CDATA[why did you write the title in English, and the article in some other language?]]></description>
			<content:encoded><![CDATA[<p>why did you write the title in English, and the article in some other language?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Symfony 2 Tips That You Will Sometime Use &#124; Craft It Online!		</title>
		<link>https://nerdpress.org/2011/09/12/symfony-2-twig-global-variables/#comment-535</link>

		<dc:creator><![CDATA[Symfony 2 Tips That You Will Sometime Use &#124; Craft It Online!]]></dc:creator>
		<pubDate>Mon, 12 Sep 2011 13:35:47 +0000</pubDate>
		<guid isPermaLink="false">https://nerdpress.org/?p=1647#comment-535</guid>

					<description><![CDATA[[...] This is a summary of global twig variables and its corresponding classes. Tweet   This entry was posted in Development, symfony by Luis Cordova. Bookmark the permalink. [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] This is a summary of global twig variables and its corresponding classes. Tweet   This entry was posted in Development, symfony by Luis Cordova. Bookmark the permalink. [&#8230;]</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
