Welcome Guest, Not a member yet? Register   Sign In
wml and html templates
#1

[eluser]miauksius[/eluser]
Hello,

I'm planing to create a site for those people, that are surfing on the net with their cell phones, I'm talking about wap site. I want to make two templates: wml - for older phones, or for those people who counts traffic; html - for everybody else.

So, could you give me some tips? I want to do this in the easyest way

Sorry for my broken english and thank you for your help!
#2

[eluser]Colin Williams[/eluser]
1.) Have two base folders within views: /wml/ and /html/ Each folder will have the same files, just different contents
2.) In your controller constructor, inspect the user agent string to determine the device. Using this determination, change a setting, like $this->base_dir, to 'wml/' or 'html/'
3.) Everytime you are loading a view, prepend $this->base_dir (e.g. $this->load->view($this->base_dir .'template', $data);




Theme © iAndrew 2016 - Forum software by © MyBB