fabpot/Silex — pull request #697 by tiraeth (2013-05-05 21:21:09+00:00)
Title: Added commonly used "asset" function to TwigCoreExtension (TwigServiceProvider)

I think that the core of every framework/library developers release should include commonly used functionality to prevent users from repeating themselves from time to time. I know that there are few service providers that add this functionality, but I personally think that it should be available with Silex (TwigServiceProvider) out of the box.

I think that there is no need to introduce the function. This PR provides the function itself, an unit test, and documentation update. If you find it useful (as I do on daily basis working with Silex) I would appreciate that you include it with 1.1 release of Silex.

The function allows user to return absolute or relative path to the resource (useful when rendering html content for emails).