Permalink
Browse files

[FrameworkBundle] fixed template name parsing for namespaced bundles

  • Loading branch information...
1 parent 38cbc61 commit 102491b9b897028e7c2ac7ac02055102a370a80f @fabpot fabpot committed Jan 15, 2011
@@ -77,7 +77,8 @@ public function parse($name, array $defaults = array())
),
$defaults,
array(
- 'bundle' => $bundle,
+ // bundle is used as part of the template path, so we need /
+ 'bundle' => str_replace('\\', '/', $bundle),
'controller' => $parts[1],
)
);
@@ -35,8 +35,8 @@ public function getParseTests()
array('FooBundle:Post:index.php.html', array('index', array('bundle' => 'FooBundle', 'controller' => 'Post', 'renderer' => 'php', 'format' => 'html'))),
array('FooBundle:Post:index.twig.html', array('index', array('bundle' => 'FooBundle', 'controller' => 'Post', 'renderer' => 'twig', 'format' => 'html'))),
array('FooBundle:Post:index.php.xml', array('index', array('bundle' => 'FooBundle', 'controller' => 'Post', 'renderer' => 'php', 'format' => 'xml'))),
- array('SensioFooBundle:Post:index.php.html', array('index', array('bundle' => 'Sensio\\FooBundle', 'controller' => 'Post', 'renderer' => 'php', 'format' => 'html'))),
- array('SensioCmsFooBundle:Post:index.php.html', array('index', array('bundle' => 'Sensio\\Cms\\FooBundle', 'controller' => 'Post', 'renderer' => 'php', 'format' => 'html'))),
+ array('SensioFooBundle:Post:index.php.html', array('index', array('bundle' => 'Sensio/FooBundle', 'controller' => 'Post', 'renderer' => 'php', 'format' => 'html'))),
+ array('SensioCmsFooBundle:Post:index.php.html', array('index', array('bundle' => 'Sensio/Cms/FooBundle', 'controller' => 'Post', 'renderer' => 'php', 'format' => 'html'))),
array(':Post:index.php.html', array('index', array('bundle' => '', 'controller' => 'Post', 'renderer' => 'php', 'format' => 'html'))),
array('::index.php.html', array('index', array('bundle' => '', 'controller' => '', 'renderer' => 'php', 'format' => 'html'))),
);

0 comments on commit 102491b

Please sign in to comment.