Welcome Guest, Not a member yet? Register   Sign In
what are the prerequisites for my application to support mobile browsers?
#2

[eluser]Juris Malinens[/eluser]
I would create 2 folders in application/views:
*application/views/web/
*application/views/mobile/

and load view like this:
Code:
$this->load->view($SITE_TYPE."/auth/login");

where $SITE_TYPE could be defined by detection of mobile browsers or by making subdomain m.mysite.com and:

Code:
function isMobile()
{
    if($_SERVER["SERVER_NAME"] == "m.mysite.com")
        return true;
    else
        return false;
}

$SITE_TYPE = isMobile() ? "mobile" : "web";

I think isMobile function could be added in helper and function can be called in __construct of controller or maybe use hooks (I personally never used them).


Messages In This Thread
what are the prerequisites for my application to support mobile browsers? - by El Forum - 05-27-2011, 03:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB