<?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>Twig | Nerdpress.org</title>
	<atom:link href="https://nerdpress.org/tag/twig/feed/" rel="self" type="application/rss+xml" />
	<link>https://nerdpress.org</link>
	<description>...dev, tech problems and solutions.</description>
	<lastBuildDate>Thu, 25 Aug 2022 09:55:54 +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>Twig Extension for Money value object</title>
		<link>https://nerdpress.org/2016/03/12/twig-extension-for-money-value-object/</link>
					<comments>https://nerdpress.org/2016/03/12/twig-extension-for-money-value-object/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Sat, 12 Mar 2016 14:29:53 +0000</pubDate>
				<category><![CDATA[Twig]]></category>
		<category><![CDATA[Twig Extension]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2672</guid>

					<description><![CDATA[<p>Update!!sebastianbergmann/money was abbandonend and the extension was ported to use https://github.com/moneyphp/money instead. I just released a twig extension for https://github.com/sebastianbergmann/money The money libary contains a money represention based on the currency&#8217;s smallest unit to provide a more accurate handling. See the libary&#8217;s readme for more information. Although the v1.x version of Money brings a Formatter &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2016/03/12/twig-extension-for-money-value-object/" class="more-link">Continue reading<span class="screen-reader-text"> "Twig Extension for Money value object"</span></a></p>
The post <a href="https://nerdpress.org/2016/03/12/twig-extension-for-money-value-object/">Twig Extension for Money value object</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p><strong>Update!!</strong><br /><a href="https://github.com/sebastianbergmann/money">sebastianbergmann/money</a> was abbandonend and the extension was ported to use <a href="https://github.com/moneyphp/money">https://github.com/moneyphp/money</a> instead. </p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>I just released a <a href="https://github.com/ivoba/money-twig-extension">twig extension</a> for <a href="https://github.com/sebastianbergmann/money">https://github.com/sebastianbergmann/money</a></p>



<p>The money libary contains a money represention based on the currency&#8217;s smallest unit to provide a more accurate handling. See the libary&#8217;s readme for more information.</p>



<p>Although the v1.x version of Money brings a Formatter the Twig extension uses its own, which is better suited and more flexible.</p>



<span id="more-2672"></span>



<p>What it does? See this:</p>



<pre class="wp-block-preformatted"><pre class="brush: plain; title: ; notranslate">
{{ money|money_i18n_format('de_DE') }} 1.123,45 €
{{ money|money_i18n_format('en_US') }} €1,123.45
{{ money|money_i18n_decimal('en_US') }} 1,123.45
{{ money|money_currency_symbol('en_US') }} €
{{ money|money_currency_name('en_US') }} Euro
</pre></pre>



<p>Check the <a href="https://github.com/ivoba/money-twig-extension">readme</a> for more information.</p>The post <a href="https://nerdpress.org/2016/03/12/twig-extension-for-money-value-object/">Twig Extension for Money value object</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2016/03/12/twig-extension-for-money-value-object/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Enable Twig-Extensions in Silex revisited</title>
		<link>https://nerdpress.org/2014/05/05/enable-twig-extensions-silex-revisited/</link>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Mon, 05 May 2014 16:20:51 +0000</pubDate>
				<category><![CDATA[Silex]]></category>
		<category><![CDATA[Twig]]></category>
		<category><![CDATA[silex]]></category>
		<category><![CDATA[Twig Extension]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2545</guid>

					<description><![CDATA[<p>As of 2014 things have changed improved a lot in the Symfony / Silex world, compared to 2011, when i first blogged about twig extensions in Silex. Things got more easy, yay! As Composer appeared, installation and autoloading is a breeze nowadays. I presume here, that you have installed your Silex project via composer. If &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2014/05/05/enable-twig-extensions-silex-revisited/" class="more-link">Continue reading<span class="screen-reader-text"> "Enable Twig-Extensions in Silex revisited"</span></a></p>
The post <a href="https://nerdpress.org/2014/05/05/enable-twig-extensions-silex-revisited/">Enable Twig-Extensions in Silex revisited</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>As of 2014 things have <del datetime="2014-05-05T16:12:03+00:00">changed</del> improved a lot in the Symfony / Silex world, compared to 2011, when <a href="https://nerdpress.org/2011/11/21/enable-twig-extensions-in-silex/">i first blogged about twig extensions in Silex</a>.<br />
Things got more easy, yay!</p>
<p>As Composer appeared, installation and autoloading is a breeze nowadays.<br />
I presume here, that you have installed your Silex project via composer.<br />
If so, you can install the twig extensions like this:<br />
<span id="more-2545"></span><br />
Just go to your project folder and run:</p>
<pre class="brush: plain; title: ; notranslate">composer require twig/extensions:~1.0</pre>
<p>and your done with installation and autoloading.</p>
<p>Now to integration and service registration, this also got more easy.</p>
<p>Place this after you have registered the twig service:</p>
<pre class="brush: php; title: ; notranslate">$app&#x5B;'twig'] = $app-&gt;share($app-&gt;extend('twig', function($twig, $app) {
    $twig-&gt;addExtension(new Twig_Extensions_Extension_Text($app));
    return $twig;
}));</pre>
<p>Thats it, now you can use the text filters in your twig templates:</p>
<pre class="brush: plain; title: ; notranslate">
{{ post.content|truncate(200)|raw }}</pre>
<p>Easy&#8230;</p>The post <a href="https://nerdpress.org/2014/05/05/enable-twig-extensions-silex-revisited/">Enable Twig-Extensions in Silex revisited</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>modulo in Twig</title>
		<link>https://nerdpress.org/2012/02/14/modulo-in-twig/</link>
					<comments>https://nerdpress.org/2012/02/14/modulo-in-twig/#comments</comments>
		
		<dc:creator><![CDATA[Ivo Bathke]]></dc:creator>
		<pubDate>Tue, 14 Feb 2012 16:05:48 +0000</pubDate>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Twig]]></category>
		<category><![CDATA[symfony 2]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=2078</guid>

					<description><![CDATA[<p>Ever wondered how to use the modulo operator in twig, the template engine of symfony? Actually its like in PHP: {{ 11 % 7 }} As described here But i guess for most use cases modulus is used to check if a number is divisible by another number. Therefore Twig has the very conveniant divisible &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2012/02/14/modulo-in-twig/" class="more-link">Continue reading<span class="screen-reader-text"> "modulo in Twig"</span></a></p>
The post <a href="https://nerdpress.org/2012/02/14/modulo-in-twig/">modulo in Twig</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Ever wondered how to use the <strong>modulo</strong> operator in twig, the template engine of symfony?</p>
<p>Actually its like in PHP:</p>
<pre class="brush: php; title: ; notranslate">{{ 11 % 7 }}</pre>
<p>As described <a href="http://twig.sensiolabs.org/doc/templates.html#math">here</a></p>
<p>But i guess for most use cases <strong>modulus</strong> is used to check if a number is divisible by another number.<br />
Therefore Twig has the very conveniant <a href="http://twig.sensiolabs.org/doc/tests/divisibleby.html">divisible by</a> test function.</p>
<pre class="brush: php; title: ; notranslate">{% if loop.index is divisible by(3) %}</pre>
<p><span id="more-2078"></span><br />
Another modulo use case is to check odd and even rows in loops. There Twig has the built-in function <a href="http://twig.sensiolabs.org/doc/functions/cycle.html">cycle</a> to help you.</p>
<pre class="brush: php; title: ; notranslate">{{ cycle(&#x5B;'odd', 'even'], i) }}</pre>
<p>Once you know its so eeasy;)</p>The post <a href="https://nerdpress.org/2012/02/14/modulo-in-twig/">modulo in Twig</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2012/02/14/modulo-in-twig/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>[Symfony 2][Twig] &#8211; Enabling (native) Twig Extensions</title>
		<link>https://nerdpress.org/2011/10/19/symfony-2-twig-enabling-native-twig-extensions/</link>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Wed, 19 Oct 2011 11:39:46 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Project Setup]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[DIC]]></category>
		<category><![CDATA[Extensions]]></category>
		<category><![CDATA[symfony 2]]></category>
		<category><![CDATA[Twig]]></category>
		<category><![CDATA[Twig Extension]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1899</guid>

					<description><![CDATA[<p>Twig Extensions is a tiny official repository for extensions to the Twig templating markup language, the default templating engine in each Symfony 2 (Standard Ed.) project. This short article shows how to purposeful enable them per-environment for your projects. The twig-extension repository is usually fetched by calling $ bin/vendor install into your project´s ./vendor directory &#8230; </p>
<p class="link-more"><a href="https://nerdpress.org/2011/10/19/symfony-2-twig-enabling-native-twig-extensions/" class="more-link">Continue reading<span class="screen-reader-text"> "[Symfony 2][Twig] &#8211; Enabling (native) Twig Extensions"</span></a></p>
The post <a href="https://nerdpress.org/2011/10/19/symfony-2-twig-enabling-native-twig-extensions/">[Symfony 2][Twig] – Enabling (native) Twig Extensions</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p><a href="https://github.com/fabpot/Twig-extensions">Twig Extensions</a> is a tiny official repository for extensions to the <a href="http://twig.sensiolabs.org/">Twig templating markup language</a>, the default templating engine in each Symfony 2 (Standard Ed.) project. This short article shows how to purposeful enable them per-environment for your projects.</p>
<p><span id="more-1899"></span></p>
<p>The twig-extension repository is usually fetched by calling</p>
<pre class="brush: bash; title: ; notranslate">
$ bin/vendor install
</pre>
<p>into your project´s ./vendor directory (because it is part of the ./deps file of each symfony 2 standard edition).</p>
<p>After installing the required vendor files, register the namespace fallback in your autoload.php (if you use the one delivered with Symfony 2 Standard, this should already have been done for you):</p>
<pre class="brush: php; title: ; notranslate">
use Symfony\Component\ClassLoader\UniversalClassLoader;
use Doctrine\Common\Annotations\AnnotationRegistry;

$loader = new UniversalClassLoader();
$loader-&gt;registerNamespaces(array(
    'Symfony'          =&gt; array(__DIR__.'/../vendor/symfony/src', __DIR__.'/../vendor/bundles'),
    // ...
));

$loader-&gt;registerPrefixes(array(
    'Twig_Extensions_' =&gt; __DIR__.'/../vendor/twig-extensions/lib',
    'Twig_'            =&gt; __DIR__.'/../vendor/twig/lib',
));
</pre>
<p>Remember that twig extensions are always registered as <a href="http://symfony.com/doc/2.0/book/service_container.html#tags-tags">tagged services</a>, but it is not always desirable to register a twig extension like e.g. the Debug-Extension as a regular service globally. We could do so by adding the service definition to the services.xml-file in one of our bundles. But due to the special purpose of the debug extension, we will choose a different, more &#8220;project-wide-configuration&#8221;-way.</p>
<p>Luckily, Symfony provides means to dynamically load services &#8220;on demand&#8221; and depending on the current <a href="http://symfony.com/doc/2.0/cookbook/configuration/environments.html">environment</a>.</p>
<p>Add the following lines to your app/config/config_dev.yml:</p>
<pre class="brush: python; title: ; notranslate">
services:
    debug.twig.extension:
        class: Twig_Extensions_Extension_Debug
        tags: &#x5B;{ name: 'twig.extension' }]
</pre>
<p>The &#8220;services&#8221;-configuration option may be utilized to register any class as a <a href="http://symfony.com/doc/2.0/book/service_container.html">DIC</a> managed <a href="http://symfony.com/doc/2.0/book/service_container.html#what-is-a-service">service</a>, for each project and independent from your bundle configuration (But remember that &#8220;regular&#8221; service definition configuration should usually happen in your bundle´s configuration files, otherwise you will not able to distribute your bundles because of missing or broken dependencies).</p>
<p>For twig extensions that should only be loaded for special purposes (like our DEBUG-function which is only needed in development environments), config_dev.yml is the perfect place to register them.</p>
<p>Note the &#8220;tags&#8221;-configuration which marks the service as a twig extension. Now, let´s create a demo twig-template and try the {% debug %} function:</p>
<pre class="brush: xml; title: ; notranslate">
{% extends &quot;NerdpressDemoBundle::layout.html.twig&quot; %}
{% debug %}
</pre>
<p>That will do. Open the page in your favorite webbrower (after defining a route, a controller and other stuff i won´t mention here) and admire the debug output. Note that the output will be much more nicer if you have had installed a native php debug extension like e.g. <a href="http://xdebug.org/">XDebug</a>.</p>The post <a href="https://nerdpress.org/2011/10/19/symfony-2-twig-enabling-native-twig-extensions/">[Symfony 2][Twig] – Enabling (native) Twig Extensions</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
		
		
			</item>
		<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: Symfony\Component\Security\Core\SecurityContext&#124;void &#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>
		<item>
		<title>[Symfony 2] AsseticBundle, Less CSS &#038; YUI Compressor unter OSX installieren</title>
		<link>https://nerdpress.org/2011/08/25/symfony-2-asseticbundle-less-css-yui-compressor-unter-osx-installieren/</link>
					<comments>https://nerdpress.org/2011/08/25/symfony-2-asseticbundle-less-css-yui-compressor-unter-osx-installieren/#comments</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 25 Aug 2011 16:55:02 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JS]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[Assetic]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[less]]></category>
		<category><![CDATA[symfony 2]]></category>
		<category><![CDATA[Twig]]></category>
		<category><![CDATA[yui-compressor]]></category>
		<guid isPermaLink="false">https://nerdpress.org/?p=1600</guid>

					<description><![CDATA[<p>Less CSS und YUI-Compressor mit Assetic unter OSX installieren und innerhalb Symfony 2 konfigurieren.</p>
The post <a href="https://nerdpress.org/2011/08/25/symfony-2-asseticbundle-less-css-yui-compressor-unter-osx-installieren/">[Symfony 2] AsseticBundle, Less CSS & YUI Compressor unter OSX installieren</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></description>
										<content:encoded><![CDATA[<p>Das AsseticBundle ist ein Wrapper um <a href="https://github.com/kriswallsmith/assetic">Assetic</a>, ein geniales Tool, um statische Assets für Webprojekte zu verwalten. AsseticBundle ist extrem einfach zu verwenden, einfach die entsprechende Filter-Chain via yaml konfigurieren, um mehr muss man sich nicht kümmern. Natürlich allerdings müssen die zugrundeliegenden Abhängigkeiten im Vorfeld installiert sein. In unserem Falle benötigen wir den <a href="http://developer.yahoo.com/yui/compressor/">Yui-Compressor</a> als jar-File und <a href="http://lesscss.org/">Less CSS</a>. Less ist ein <a href="http://nodejs.org/">node.js</a> Modul, was bedingt, dass wir zuvor node.js installieren müssen.<br />
<span id="more-1600"></span></p>
<p>Also node.js via macports holen:</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo port install nodejs
</pre>
<p>Und den node.js-eigenen Package-Manager:</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo port install npm
</pre>
<p>Mit diesem installieren wir als nächsts less, und zwar &#8220;global&#8221; (via -g)-Flag (&#8220;global&#8221; bedeutet, dass das Modul unter $nodejs_lib_path/../node_modules abgelegt wird, ansonsten wird es im aktuellen Arbeitsverzeichnis unter ./node_modules installiert):</p>
<pre class="brush: bash; title: ; notranslate">
$ sudo npm install -g less
</pre>
<p>Damit haben wir alles, um unsere less CSS Stylesheets kompilieren zu können.</p>
<p>Als nächstes holen wir uns den Yui-Kompressor, diesen habe ich mir einfach aus dem Netz gezogen und unter app/java/yuicompressor-2.4.6.jar abgelegt (Die Binary findet ihr unter <a href="http://developer.yahoo.com/yui/compressor/">http://developer.yahoo.com/yui/compressor/</a>).</p>
<p>Nun die Konfiguration:</p>
<p>app/config.yml:</p>
<pre class="brush: python; title: ; notranslate">
# Assetic Configuration
assetic:
    debug:          %kernel.debug%
    use_controller: false
    filters:
        cssrewrite: ~
        less:
          node: /opt/local/bin/node
          node_paths: &#x5B;/opt/local/lib/node, /opt/local/lib/node_modules]
        yui_css:
          jar: %kernel.root_dir%/java/yuicompressor-2.4.6.jar
</pre>
<p>Zu beachten sind die &#8220;node_paths&#8221;. Der node.js-Modulpfad muss explizit angegeben werden, sonst kann node.js die require()-Statements nicht auflösen (das sind sozusagen die node.js-&#8220;Classpaths&#8221;). /opt/local/lib/node zeigt auf Core-Module, in /opt/local/lib/node_modules liegt unser less.</p>
<p>Um den Yui-Kompressor zu aktivieren, reicht der simple Pfad zur .jar-Datei.</p>
<p>Nun müssen wir nur noch unser Twig-Layout anpassen:</p>
<p>src/Nerdpress/DemoBundle/Resources/views/layout.html.twig:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!DOCTYPE html&gt;
&lt;html&gt;
    &lt;head&gt;
        &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
        {% stylesheets
                '@NerdpressDemoBundle/Resources/public/css/main.css'
                '@NerdpressDemoBundle/Resources/public/css/layout.css'
        	filter='less,?yui_css'
                combine=true
        %}
          &lt;link rel=&quot;stylesheet&quot; href=&quot;{{ asset_url }}&quot; type=&quot;text/css&quot; media=&quot;all&quot; /&gt;
        {% endstylesheets %}
</pre>
<p>Das &#8220;?&#8221; vor dem Filter &#8220;yui_css&#8221; bedingt, dass die CSS-Compression nur angeschaltet wird, wenn der Debug-Parameter auf false steht. &#8220;Combine&#8221; bedeutet, dass alle CSS-Dateien in einer einzigen, großen Datei zusammengefügt werden, und &#8220;less&#8221; bedeutet letztlich, dass alle CSS-Dateien mittels less CSS precompiled werden.</p>
<p>That´s it. Die Seite im Browser öffnen und das Ergebnis bewundern. Viel Spaß! Symfony ist schon was feines&#8230;</p>The post <a href="https://nerdpress.org/2011/08/25/symfony-2-asseticbundle-less-css-yui-compressor-unter-osx-installieren/">[Symfony 2] AsseticBundle, Less CSS & YUI Compressor unter OSX installieren</a> first appeared on <a href="https://nerdpress.org">Nerdpress.org</a>.]]></content:encoded>
					
					<wfw:commentRss>https://nerdpress.org/2011/08/25/symfony-2-asseticbundle-less-css-yui-compressor-unter-osx-installieren/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
	</channel>
</rss>
