@@ -146,26 +146,33 @@ protected function parseImport(RouteCollection $collection, \DOMElement $node, $
146146
147147 $ this ->setCurrentDir (dirname ($ path ));
148148
149- $ subCollection = $ this ->import ($ resource , ('' !== $ type ? $ type : null ), false , $ file );
150- /* @var $subCollection RouteCollection */
151- $ subCollection ->addPrefix ($ prefix );
152- if (null !== $ host ) {
153- $ subCollection ->setHost ($ host );
154- }
155- if (null !== $ condition ) {
156- $ subCollection ->setCondition ($ condition );
157- }
158- if (null !== $ schemes ) {
159- $ subCollection ->setSchemes ($ schemes );
160- }
161- if (null !== $ methods ) {
162- $ subCollection ->setMethods ($ methods );
149+ $ imported = $ this ->import ($ resource , ('' !== $ type ? $ type : null ), false , $ file );
150+
151+ if (!is_array ($ imported )) {
152+ $ imported = array ($ imported );
163153 }
164- $ subCollection ->addDefaults ($ defaults );
165- $ subCollection ->addRequirements ($ requirements );
166- $ subCollection ->addOptions ($ options );
167154
168- $ collection ->addCollection ($ subCollection );
155+ foreach ($ imported as $ subCollection ) {
156+ /* @var $subCollection RouteCollection */
157+ $ subCollection ->addPrefix ($ prefix );
158+ if (null !== $ host ) {
159+ $ subCollection ->setHost ($ host );
160+ }
161+ if (null !== $ condition ) {
162+ $ subCollection ->setCondition ($ condition );
163+ }
164+ if (null !== $ schemes ) {
165+ $ subCollection ->setSchemes ($ schemes );
166+ }
167+ if (null !== $ methods ) {
168+ $ subCollection ->setMethods ($ methods );
169+ }
170+ $ subCollection ->addDefaults ($ defaults );
171+ $ subCollection ->addRequirements ($ requirements );
172+ $ subCollection ->addOptions ($ options );
173+
174+ $ collection ->addCollection ($ subCollection );
175+ }
169176 }
170177
171178 /**
0 commit comments