lib/tags/twig.tag.assets.js
function (token, context, chain) {

			var i ,
				len ,
				files = [] ,
				output = '' ,
				viewData = Object.create(context) ,
				env = container.getParameter('kernel.environment') ,
				data = container.get('assets.template.helper.assets')
								.assets(token.files[0], token.files[1], token.files[2], false);

			if (env === 'development') {

				// dev environments print all of the files one-by-one
				data.files.forEach(function(file) {
					files.push(file + '?' + data.versionParameter + '=' + data.version);
				});

			} else {

				// prod or test print the combined file only
				files = [data.combinedFile];

			}

			// render the output one file at a time, respectively injecting URL into each
			for (i = 0, len = files.length; i < len; i++) {
				viewData.url = files[i];
				output += Twig.parse.apply(this, [token.output, viewData]);
			}

			return {
				chain: chain,
				output: output
			};
		}
function (token, context, chain) {

			var i ,
				len ,
				files = [] ,
				output = '' ,
				viewData = Object.create(context) ,
				env = container.getParameter('kernel.environment') ,
				data = container.get('assets.template.helper.assets')
								.assets(token.files[0], token.files[1], token.files[2], false);

			if (env === 'development') {

				// dev environments print all of the files one-by-one
				data.files.forEach(function(file) {
					files.push(file + '?' + data.versionParameter + '=' + data.version);
				});

			} else {

				// prod or test print the combined file only
				files = [data.combinedFile];

			}

			// render the output one file at a time, respectively injecting URL into each
			for (i = 0, len = files.length; i < len; i++) {
				viewData.url = files[i];
				output += Twig.parse.apply(this, [token.output, viewData]);
			}

			return {
				chain: chain,
				output: output
			};
		}
function ( token , context , chain ) { var i , len , files = [ ] , output = '' , viewData = Object . create ( context ) , env = container . getParameter ( 'kernel.environment' ) , data = container . get ( 'assets.template.helper.assets' ) . assets ( token . files [ 0 ] , token . files [ 1 ] , token . files [ 2 ] , false ) ; if ( env === 'development' ) { // dev environments print all of the files one-by-one data . files . forEach ( function ( file ) { files . push ( file + '?' + data . versionParameter + '=' + data . version ) ; } ) ; } else { // prod or test print the combined file only files = [ data . combinedFile ] ; } // render the output one file at a time, respectively injecting URL into each for ( i = 0 , len = files . length ; i < len ; i ++ ) { viewData . url = files [ i ] ; output += Twig . parse . apply ( this , [ token . output , viewData ] ) ; } return { chain : chain , output : output } ; }
Runs when the template is rendered
Runs when the template is rendered