<?php

/*
 * This file is part of the Symfony framework.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\Yaml\Yaml;

/**
 * This pass adds Assetic routes when use_controller is true.
 *
 * @author Kris Wallsmith <kris@symfony.com>
 */
class RouterResourcePass implements CompilerPassInterface
{
    public function process(ContainerBuilder $container)
    {
        if (!$container->getParameter('assetic.use_controller') || !$container->getParameter('router.resource')) {
            return;
        }

        $file = $container->getParameter('kernel.cache_dir').'/assetic/routing.yml';

        if (!is_dir($dir = dirname($file))) {
            mkdir($dir, 0777, true);
        }

        file_put_contents($file, Yaml::dump(array(
            '_assetic' => array('resource' => '.', 'type' => 'assetic'),
            '_app'     => array('resource' => $container->getParameter('router.resource')),
        )));

        $container->setParameter('router.resource', $file);
    }
}

<?php

/*
 * This file is part of the Symfony framework.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Symfony\Bundle\AsseticBundle\DependencyInjection\Compiler;

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\Yaml\Yaml;

/**
 * This pass adds Assetic routes when use_controller is true.
 *
 * @author Kris Wallsmith <kris@symfony.com>
 */
class RouterResourcePass implements CompilerPassInterface
{
    public function process(ContainerBuilder $container)
    {
        $useController = $container->getParameterBag()->resolveValue($container->getParameter('assetic.use_controller'));
        $routerResource = $container->getParameterBag()->resolveValue($container->getParameter('router.resource'));

        if (!$useController || !$routerResource) {
            return;
        }
        
        $file = $container->getParameter('kernel.cache_dir').'/assetic/routing.yml';

        if (!is_dir($dir = dirname($file))) {
            mkdir($dir, 0777, true);
        }

        file_put_contents($file, Yaml::dump(array(
            '_assetic' => array('resource' => '.', 'type' => 'assetic'),
            '_app'     => array('resource' => $container->getParameter('router.resource')),
        )));

        $container->setParameter('router.resource', $file);
    }
}

Resolve values before looking at them
Resolve values before looking at them

At least for use_controller the default value defined in Symfony\Bundle\AsseticBundle\DependencyInjection\Configuration is "%kernel.debug%", which you will get literally as a string if you don't call resolveValue().