Category: snippet


Symfony2 – Get action name from twig templates

January 27th, 2012 — 1:49pm

This is the easyest way that I have found to get the action name from a twig template:

 
{{ app.request.attributes.get('_template').get('name') }}

…and the controller object:

 
{{ app.request.attributes.get('_template').get('controller') }}

Comment » | snippet, Symfony2, twig

Snippet: Recursively Remove .svn Directories in Linux

January 29th, 2010 — 12:24am

Just a couple of snippets found in the net to make my life easier.
In the first one beware of the grave accent quotes.

rm -rf `find . -type d -name .svn`

or someone else proposed

find ./ -name .svn | xargs rm -fr

Comment » | Linux, snippet

Easy configuring timezone in web server

September 18th, 2009 — 12:36pm

Simply Include the next line in the .htaccess file of your web server:

php_value date.timezone Europe/Madrid

Here you can see the complete List of Supported Timezones.

Comment » | snippet, tips

Back to top