0

我想做这样的事情

我的 Symfony 项目的移动版本

当文件 xxxSuccess.mobile.php 不存在时,它应该加载 xxxSuccess.php。它工作正常。但它不适用于局部。我想加载_partialfilename.mobile.php,但如果它不存在,它应该加载_partialfilename.php。如何让它发挥作用?

4

1 回答 1

1

You need to make your own PartialView class from sfPartialView and change the render() method in a similar way like you did with the template. You can do it per module, with module.yml. Have a look at the get_partial function in PartialHelper.php to see how it works. Same thing for components, if you need it in the future .

于 2012-04-13T19:56:00.447 回答