Welcome Guest, Not a member yet? Register   Sign In
is mobile
#1

[eluser]simonspoken[/eluser]
Hi,

I've just started using CodeIgniter today, on recommendation from a friend. Very impressed, and I already have plans of moving all of our sites over to it!

We do a lot of mobile web development, so I'd like to be able to hook into our device database.

In order to do this, I need to take the User Agent and pass it into our API. Our API will then return an XML file which can be parsed, and the controller can take it from there.

I'm thinking it makes sense to figure out how CodeIgniter is figuring out how a user is on a mobile device or not, and then build on top of it. Is that correct?

If so, where can I find the code for this? I've had a quick look but can't see it.
If not, is a helper what I need?

Thanks
#2

[eluser]Alex007[/eluser]
http://ellislab.com/codeigniter/user-gui...agent.html

The USer Agent class is a library, look for it in your System/libraries folder, it will be a php file.

You'll find out how CI decides if it'S a mobile device or not.
#3

[eluser]simonspoken[/eluser]
Excellent - I didn't spot that file. I was looking outside of the applications directory. I think it's worth developing a helper for it...

Thanks for your help. Smile
#4

[eluser]xwero[/eluser]
the user agent library has is_mobile and mobile methods.

edit: beaten Smile




Theme © iAndrew 2016 - Forum software by © MyBB