Welcome Guest, Not a member yet? Register   Sign In
How do i load different views?
#2

It seems to me that your code is working fine: BUT

Your first if statement is asking:
Code:
if($this->detect->isMobile() || $_SERVER['HTTP_HOST'] === MOBILE_URL){

Which is

Quote:if ((I detect it is a mobile device) OR (The url is a mobile url)) {  then give mobile content }

But, on your PC you fail the first test, but since you are using a mobile url, you pass the second test.

If you are suggesting that, on a PC, if I use the mobile url, I should get PC content, (which I do not think is right) you should recode it to do something like:

Quote:If (I detect it is a mobile device) { give mobile content }
else if (I detect it is a pc) { give pc content }
else (if it is a mobile url) {give mobile content}
else { give pc content }

I am making lots of assumptions about how you are detecting a mobile device, but the url only comes into play if it cannot detect the device type.

This is a waste of time though. I would always give mobile content if a mobile url is being used, whatever the device, just as you are currently doing.

Best wishes

Paul
Reply


Messages In This Thread
How do i load different views? - by waptik - 03-26-2016, 11:32 AM
RE: How do i load different views? - by PaulD - 03-26-2016, 03:12 PM
RE: How do i load different views? - by waptik - 03-26-2016, 08:42 PM
RE: How do i load different views? - by PaulD - 03-27-2016, 07:44 AM
RE: How do i load different views? - by waptik - 03-27-2016, 10:28 PM
RE: How do i load different views? - by waptik - 03-27-2016, 10:34 PM
RE: How do i load different views? - by arma7x - 03-28-2016, 12:04 AM
RE: How do i load different views? - by waptik - 03-28-2016, 07:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB