瀏覽代碼

[AsseticBundle] updated configuration to assume values with integer keys are inputs

Kris Wallsmith 14 年之前
父節點
當前提交
fb104cedf8

+ 6 - 2
src/Symfony/Bundle/AsseticBundle/DependencyInjection/Configuration.php

@@ -101,9 +101,13 @@ class Configuration implements ConfigurationInterface
                                     }
                                 }
 
-                                // organize arbitrary options
+                                // organize inputs and arbitrary options
+                                $inputsKey = isset($v['input']) ? 'input' : 'inputs';
                                 foreach ($v as $key => $value) {
-                                    if (!in_array($key, array('input', 'inputs', 'filter', 'filters', 'option', 'options'))) {
+                                    if (is_integer($key)) {
+                                        $v[$inputsKey][] = $value;
+                                        unset($v[$key]);
+                                    } elseif (!in_array($key, array('input', 'inputs', 'filter', 'filters', 'option', 'options'))) {
                                         $v['options'][$key] = $value;
                                         unset($v[$key]);
                                     }

+ 4 - 0
src/Symfony/Bundle/AsseticBundle/Tests/Resources/config/config.yml

@@ -21,6 +21,10 @@ assetic:
     bundles:        [ TestBundle ]
     assets:
         jquery: js/jquery.js
+        foo:
+            - foo.css
+            - bar.css
+            filters: ?yui_css
         app_css:
             inputs:
                 - css/main.css