Archive

Posts Tagged ‘mobile’

Android 3G settings for Cytamobile-Vodafone

June 3rd, 2011 No comments
  • Go into Settings.
  • Then Wireless and networks.
  • Then Mobile networks (Set options for roaming, networks, APNs).
  • Then Access Point Names

If you already have an entry there for CyTA, then select it to edit it, otherwise add a new APN. Now, just make sure everything matches these settings:

  • Name: whatever_you_want
  • APN: internet
  • Proxy: <Not set>
  • Port: <Not set>
  • Username: <Not set>
  • Password: <Not set>
  • Server: <Not set>
  • MMSC: <Not set>
  • MMS proxy: <Not set>
  • MMS port: <Not set>
  • MMS protocol: WAP 2.0
  • MCC: 280
  • MNC: 01
  • Authentication type: <Not set>
  • APN type: <Not set>

Save, exit and enable 3G.

Themes in CakePHP 2.0.0

May 23rd, 2011 5 comments

I’ve spent the best part of half a day trying to figure out why themes were not working for me in CakePHP 2.0.0

The closest I got to a solution can be found over on stackoverflow.com.

Difference is that you need to set $this->viewClass to ‘Theme’ instead of $this->view, but there are 2 more unmentioned issues with the sample code provided as a solution:

public function beforeRender() {
	if ($this->RequestHandler->isMobile()) {
		$this->viewClass = 'Theme';
		$this->theme = 'mobile';
	}
}

The first is that RequestHandler has been replaced by request.

So you may use:

if ($this->request->isMobile()) {

or

if ($this->request->is('mobile')) {

The other is that despite you’ve named your theme ‘mobile’, CakePHP’s new CamelCasing behaviours will turn this into ‘Mobile’. Because of this, you need your theme’s files to be located in ‘app/View/Themed/Mobile‘, and not in ‘app/View/Themed/mobile‘.

Categories: All, PHP, Web