Welcome Guest, Not a member yet? Register   Sign In
how to make multi version in codeigniter for mobile and desktop
#2

(This post was last modified: 11-11-2017, 12:43 PM by PaulD. Edit Reason: Added link )

I think the docs are pretty clear on this.

https://www.codeigniter.com/user_guide/l...:is_mobile

In essence, you test to see if it is a mobile device, and if it is, load a specific view, or if not, load a different view.

If you just load views in your controller, you might do something like the example given in the docs and load different views. If you keep your different views in different sub folders, you could use the if statement to set the folder name and use that variable in your view call. You might need some checks to see if the view exists or not as well.

Alternatively, if you have created a template library of some sort, you would only have to do the mobile check once in your template library, also very easy to modify rather than changing all your controllers.

If you show a sample of how you load your views we might be able to offer a bit more specific advice. As with everything CI, how you actually use the tools provided varies on how you have decided to implement your website.

Paul

More info here: https://stackoverflow.com/questions/6209...odeigniter
Or here: https://digitizor.com/codeigniter-mobile-browser/
And lots more on Bing
Reply


Messages In This Thread
RE: how to make multi version in codeigniter for mobile and desktop - by PaulD - 11-11-2017, 12:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB