Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mobile version of site using CodeIgniter

What I want to do is to create a mobile version of my web site in CodeIgniter.

I want to redirect my complete web site to m.example.com

There will be no change in controllers, neither in views and models. Both will be the same.

I don't want to change my .htaccess file. Any possible solutions for this?

like image 310
Onur Avatar asked Dec 01 '22 20:12

Onur


1 Answers

The user agent class has a function;

$this->agent->is_mobile();

You could use this in the construct of your base controller(s) to test if mobile.

like image 98
Rooneyl Avatar answered Dec 26 '22 18:12

Rooneyl