For complex pages, I cant totally rely on responsive design. I would like to write view code in different files.
As long as I see, there are two solutions.
[list=1]
[*]Inherit and overwrite Views’s render() method, inside the new render(), detect the device, and design which file should be use, i.e: page.html or page.mobile.html.
[*]Create a new theme called ‘mobile’. Design which theme to use in beforeAction() or beforRequest();
[/list]
Can anyone tell me which is better. Or may be both are not good enough? Are there other better ones? Thanks.
Yes, using theme is simpler. However I wonder if it is a good practice to use theme in this way. I think theme is more about styles (as what its name mean). For example,
a "forest" theme or a "iron" theme. Maybe one day we will need forest theme on both PC and mobile?