我想做这样的事情
当文件 xxxSuccess.mobile.php 不存在时,它应该加载 xxxSuccess.php。它工作正常。但它不适用于局部。我想加载_partialfilename.mobile.php,但如果它不存在,它应该加载_partialfilename.php。如何让它发挥作用?
我想做这样的事情
当文件 xxxSuccess.mobile.php 不存在时,它应该加载 xxxSuccess.php。它工作正常。但它不适用于局部。我想加载_partialfilename.mobile.php,但如果它不存在,它应该加载_partialfilename.php。如何让它发挥作用?
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 .