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

[eluser]Unknown[/eluser]
Hi Friends,

I am new to CodeIgniter Framework. I have the requirement like give support for mobile browsers for an application which is already developed using CodeIgniter framework and running in the web browsers..

As I am very new to the CodeIgniter. I don't know where i have to start.

Functionality wise i have no changes but design wise i have lot of changes in my application when compares to web based application..

I am keeping all the web based application code in different folder and trying to modify it for giving mobile support..

Please guide me the ways i can fallow to give support for mobile browsers too..


Thanks and Regards,

Kiran.
#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).




Theme © iAndrew 2016 - Forum software by © MyBB