0

I want to make sth like this

Mobile version of my Symfony project

when file xxxSuccess.mobile.php does not exist, it should load xxxSuccess.php. It works OK. But it doesn't work with partials. I want to load _partialfilename.mobile.php but if it doesn't exist it should load _partialfilename.php. How to make it work?

Community
  • 1
  • 1
latata
  • 1,703
  • 5
  • 27
  • 57

1 Answers1

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 .

Vlad Jula-Nedelcu
  • 1,681
  • 11
  • 17