Posts Tagged ‘mobile’

jfPortableDevicePlugin: Symfony to go

Sunday, February 27th, 2011

I wrote a symfony plugin that allows you to easily optimize your existing symfony application for mobile devices using jQuery Mobile.
And if you want to distribute your application in Android Market or Apple App Store it is possible using e.g. Phonegap.

If you wish to see the plugin in action you can visit the mobile version of my web page http://www.jonasfischer.net/m.

If you are visiting my website using one of the supported operating systems (e.g. iOs or Android) then you will be prompted if you wish to view the mobile-enhanced version or the regular version: http://www.jonasfischer.net/.

(more…)

Symfony Filter: redirect depending on requesting user agent (e.g. detect mobile devices)

Thursday, November 26th, 2009

I wrote two filters that allow you to configure redirect rules for requests sent from special user agents e.g. iphone, android & co.

If the requesting user agent matches the redirect rules then the redirect is issued using HTTP Headers. As a fallback for cached pages, the redirect is issued again using javascript (the filter inserts some lines of javascript code in the -section of your document).

The first one, redirectUserAgentFilter, is a generic approach to redirects depending on the user agent string. You can activate it in your filters.yml using these lines:

redirectUserAgent:
  class:  redirectUserAgentFilter
  enabled: on
  param:
    redirectUrl: http://mobile.yourdomain.com
    userAgents:
      - android
      - iphone
      - ipod

In this case, the filter would redirect all requests coming from user agents containing “android”, “iphone” oder “ipod” in their names to http://mobile.yourdomain.com.
(more…)