Welcome Guest, Not a member yet? Register   Sign In
App Structure
#1

[eluser]Johnathan1707[/eluser]
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
#2

[eluser]Vheissu[/eluser]
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: http://ellislab.com/codeigniter/user-gui...agent.html

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.
#3

[eluser]Johnathan1707[/eluser]
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.
#4

[eluser]InsiteFX[/eluser]
Try this.

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

iPad is not in the CodeIgniter User Agent config file.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB