App Structure

Hey, I'm building a web app and a bit unsure as to how to actually structure it.
Altogether the app will have..

Site - Pricing, support, FAQ etc
App -
- iPad
- iPhone
- Browser

What way should I set up the structure? I was thinking about have one controller for each, so one for 'site', one for 'iPad' etc but ran into some complications doing it that way. I asked about this a week or so ago on the ICR channel but lost the links I was sent.
What would be the best way to do this, all app version will run of the same code, only the views will change.

Thanks Smile

Codeigniter has an in-built user agent class that can tell you what the user agent is and also tell you if a visitor is using a mobile browser, it's a start:

Really when you're developing a website for mobile devices (well modern ones) you're only changing the width and positioning of things. The best way might be to do some kind of detection in your page constructor and then set some kind variable that will render different views.

The iPad and iPhone are the same browser, different resolutions. I would only use one controller and do detection in the constructor as I said earlier. That's my 2 cents.

I know about the user agent library, but couldn't get it to detect and iPad last night, only iPhone. And Serving the same views for each won't work, it's not a mobile site, it's an actual app that will look totally different on both devices.

Try this.

$is_ipad = (bool) strpos($_SERVER['HTTP_USER_AGENT'],'iPad');

iPad is not in the CodeIgniter User Agent config file.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.