Archives


Master Symfony2 fundamentals

Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).
trainings.sensiolabs.com

Symfony hosting done right

ServerGrove, outstanding support at the right price for your Symfony hosting needs.
servergrove.com

Discover the SensioLabs Support

Access to the SensioLabs Competency Center for an exclusive and tailor-made support on Symfony
sensiolabs.com

Fabien Potencier
How to create an optimized version of your website for the iPhone in symfony 1.1
by Fabien Potencier – June 09, 2008 – 36 comments

symfony 1.1 introduces native support for different formats and mime-types. This means that the same model and controller can have different templates based on the requested format. The default format is still HTML but symfony supports several other formats out of the box as defined in the factories.yml file:

request:
  class: sfWebRequest
    param:
      formats:
        txt:  text/plain
        js:   [application/javascript, application/x-javascript, text/javascript]
        css:  text/css
        json: [application/json, application/x-json]
        xml:  [text/xml, application/xml, application/x-xml]
        rdf:  application/rdf+xml
        atom: application/atom+xml
 

Each format is associated with one or more mime-types. These mime-types are used to automatically determine the requested format by parsing the Accept HTTP header. This comes in very handy if you want to make your data available via a browser and expose them as a Web Service. To change the format of the response, a Web Service client can just change the Accept header as shown below:

$ curl -H "Accept: application/xml"  http://ws.example.com/api/article # to get a XML representation of the data
$ curl -H "Accept: application/json" http://ws.example.com/api/article # to get a JSON representation of the data

Supporting different formats is as easy as creating different templates. So, let's say the web service is managed by an api/article action. Here is the list of templates you have to create in apps/frontend/modules/api/templates to support HTML, XML, and JSON formats:

  • articleSuccess.php
  • articleSuccess.xml.php
  • articleSuccess.json.php

By default, symfony will change the response Content-Type according to the format, and for all non-HTML formats, the layout will be disabled. Even partials and layouts can be different based on the requested format. For example, if you include a list partial in a template, the loaded partial name will depend on the current format:

  • _list.php
  • _list.xml.php
  • _list.json.php

Let's take another example. You want to create some stylesheets or JavaScript files on the fly. As you can't always rely on the browser Accept HTTP header for those cases, you can force a format by using the special sf_format variable in your routing rules. Here is how to create a route for a dynamic stylesheet:

css1:
  url:   /css/dynamic1.css
  param: { module: css, action: dynamic, sf_format: css }
 

You can also use the sf_format variable in the URL pattern to allow several formats for one action:

api_article:
  url:   /api/article.:sf_format
  param: { module: api, action: article }
  requirements:
    sf_format: (?:html|xml|json)
 

Most of the time, you don't have to change a single line in your actions to support new formats; but if you really need to do something special for a format, you can call the $request->getRequestFormat() to get the current format and act accordingly.

Ok, now for the fun part! Let's say you want to create an optimized version of your website for the iPhone. The iphone format does not exist by default but it's pretty easy to configure one. First, we need a way to determine that a request comes from an iPhone. If the User-Agent header contains the words Mobile and Safari, we can safely guess that the browser is an iPhone. We can put this logic in the ProjectConfiguration class by registering a listener for the request.filter_parameters event:

// config/ProjectConfiguration.class.php
class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    // ...
 
    $this->dispatcher->connect('request.filter_parameters', array($this, 'filterRequestParameters'));
  }
 
  public function filterRequestParameters(sfEvent $event, $parameters)
  {
    $request = $event->getSubject();
 
    if (preg_match('#Mobile/.+Safari#i', $request->getHttpHeader('User-Agent')))
    {
      $request->setRequestFormat('iphone');
    }
 
    return $parameters;
  }
}
 

Now, everytime a request comes in, the filterParameters() method is called and if the browser is an iPhone, the request format is changed to iphone.

That's all! Now, every request from an iPhone will use *Success.iphone.php templates instead of *Success.php templates.

If you use some special stylesheets of JavaScript files to support the iPhone (for example if you use the iui library), you can also configure the view by listening to the view.configure_format:

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    // ...
 
    $this->dispatcher->connect('view.configure_format', array($this, 'configureIPhoneFormat'));
  }
 
  public function configureIPhoneFormat(sfEvent $event)
  {
    if ('iphone' == $event['format'])
    {
      // add some CSS, stylesheet, or whatever you want
    }
  }
}
 

Today, Apple launched the new iPhone 2. To celebrate this event, I'm pleased to announce that the symfony API documentation is now available for the iPhone with a specific interface as you can see in the screenshot below.

Thanks to the new format support in symfony 1.1, developing websites that supports Web Services, API or the iPhone has never been easier. Supporting a new format is as easy as creating a new set of templates. Enjoy!

Comments RSS

  • gravatar
    #1 mozey said on the 2008/06/09 at 23:32
    You guys are doing such an amazing job making us NOT THINK about anything!.
  • gravatar
    #2 Celso said on the 2008/06/10 at 01:43
    thanks.
    sf still the best

  • gravatar
    #3 scrivner said on the 2008/06/10 at 05:33
    Symfony FTW!
    Thank you for this beautiful framework!
    Is not just a framework, is a way of life!
    Thank you!
  • gravatar
    #4 dave said on the 2008/06/10 at 06:23
    It took me a few minutes to get this up and running. There are a few minor corrections to your example.

    The method name, 'filterRequestParameters' doesn't match the one in your connect call, 'filterParameters'.

    I needed to replace '$dispatcher' with '$this->dispatcher' - maybe that was implied by '// ...'?

    And you also need to create a layout called 'layout.iphone.php'.

    :)

    Other than that -- it's gorgeous!


    // config/ProjectConfiguration.class.php
    class ProjectConfiguration extends sfProjectConfiguration
    {
    public function setup()
    {
    // ...

    $this->dispatcher->connect('request.filter_parameters', array($this, 'filterRequestParameters'));
    }

    public function filterRequestParameters(sfEvent $event, $parameters)
    {
    $request = $event->getSubject();

    if (preg_match('#Mobile/.+Safari#i', $request->getHttpHeader('User-Agent')))
    {
    $request->setRequestFormat('iphone');
    }

    return $parameters;
    }
    }


  • gravatar
    #5 fabien said on the 2008/06/10 at 06:53
    @dave: thanks for the feedback. I've fixed the examples.
  • gravatar
    #6 akuna said on the 2008/06/10 at 07:29
    Ah, hells yeah. This is nice. I am currently spitting out json and html for one of my projects, but this method is much cleaner.

    Looking forward to start using 1.1.

    Do validators work with this?
  • gravatar
    #7 Jordi said on the 2008/06/10 at 08:00
    This looks impressing!

    Is there some docs on customizing sfProjectConfiguration and an explained list of those events like view.configure_format you can modify?
  • gravatar
    #8 fabien said on the 2008/06/10 at 09:30
    @Jordi: All the events are described in the symfony book:

    http://www.symfony-project.org/book/1_1/17-Extending-Symfony#Built-In%20Events
  • gravatar
    #9 Pierre Minnieur said on the 2008/06/10 at 10:17
    Holy shot. That's the release I've waited for a long time :) Great job and thank you for your efforts, and making symfony OSS!

    I'm looking forward to the 1.1 stable release.
  • gravatar
    #10 Raphael said on the 2008/06/10 at 13:22
    Great! Me as well looking forward to start projects based on 1.1.
    I presume the iPhone stuff is identically working for the iPod-Touch as well, as the latter is based on the same software system as the iPhone (e.g. Mobile Safari)?
    Cheers RAPHAEL
  • gravatar
    #11 Hugo said on the 2008/06/10 at 14:15
    What a very great news :p
  • gravatar
    #12 Me said on the 2008/06/13 at 09:18
    Nice, but why iPhone? There are tons of other mobile phones too... Rather than optimizing for iPhone, it'd be much better to optimize for all small screen devices.
  • gravatar
    #13 Grumph said on the 2008/06/13 at 12:09
    iPhone will rule da world.
  • gravatar
    #14 reeze said on the 2008/06/16 at 09:39
    the routing rule :
    url: /api/article:.sf_format
    should be:
    url: /api/article.:sf_format ?
  • gravatar
    #15 fabien said on the 2008/06/16 at 10:56
    @reeze: you're right. It was a typo. Thanks.
  • gravatar
    #16 Gyncfalevencev said on the 2008/06/20 at 21:55
    0089. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Personal Unsecured Loans Online With Very Bad Credit</b></a>
    04316. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Alternative Student Loans Bad Credit</b></a>
    04874. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Very Bad Credit Personal Loans</b></a>
    04950. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Bad Credit High Loan Personal Risk Unsecured</b></a>
    05363. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Free Mp3 Ringtones</b></a>
    06489. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Samsung T100 Ringtones</b></a>
    07057. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Annual Credit Report Free</b></a>
    07633. <a href=http://kverizonringtones.weebly.com/><b>Ringtones For Verizon Cell Phones</b></a>
    08753. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Ringophone Verizon Polyphonic Ringtones</b></a>
    0882. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Download Free Polyphonic Ringtones</b></a>
  • gravatar
    #17 Bribrainanis said on the 2008/06/21 at 21:06
    00857. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Personal Loan Michigan</b></a>
    04340. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Guaranteed Bad Credit Student Loans</b></a>
    04885. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Free Bad Credit Personal Loans</b></a>
    04995. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Find Unsecured Personal Loans For Very Very Bad Credit</b></a>
    05315. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Lg Ringtones</b></a>
    06429. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Ringback Ringtones</b></a>
    07044. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>National Free Credit Report</b></a>
    07655. <a href=http://kverizonringtones.weebly.com/><b>Free Downloadable Ringtones For Verizon</b></a>
    08780. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Free Ringtones For Verizon Customers</b></a>
    08874. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Free Download Ringtones</b></a>
  • gravatar
    #18 Gyncfalevenceg said on the 2008/06/21 at 21:56
    00870. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Personal Loan Guaranteed Bad Credit Loans Online Application</b></a>
    04345. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Alternative Student Loans For Students With Bad Credit</b></a>
    04816. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Personal Loans Bad Credit</b></a>
    0495. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Instant Approval Unsecured Personal Loans For Bad Credit</b></a>
    05380. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Free Cell Phone Ringtones</b></a>
    06445. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Christian Ringtones</b></a>
    07045. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Free Instant Credit Reports</b></a>
    0768. <a href=http://kverizonringtones.weebly.com/><b>Ringtones Free Verizon</b></a>
    08731. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Making Ringtones For Verizon Phones</b></a>
    08894. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Free Mobile Ringtones Download</b></a>
  • gravatar
    #19 Gyncfalevencek said on the 2008/06/22 at 06:23
    00891. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>No Credit Personal Loans</b></a>
    04366. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Bad Credit Loan Student</b></a>
    04822. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Bad Credit Personal Loan For Auto Purchase</b></a>
    04931. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Unsecured Personal Loans Bad Credit Uk</b></a>
    05392. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Totally Free Ringtones</b></a>
    06456. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Nokia 1260 Ringtones</b></a>
    07052. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Free Annual Credit Reports</b></a>
    07649. <a href=http://kverizonringtones.weebly.com/><b>Verizon V3M Ringtones</b></a>
    08716. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Ringtones For Verizon Phones</b></a>
    08860. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Download Free Poly Ringtones</b></a>
  • gravatar
    #20 HailaHabbuhp said on the 2008/06/22 at 07:06
    00895. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Personal Loan Washington</b></a>
    0431. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Alternative Student Loans Bad Credit</b></a>
    04861. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Personal Loans For Bad Credit Repair</b></a>
    0496. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Bad Poor Horrible Credit Unsecured Personal Loans</b></a>
    05379. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Free Samsung Ringtones</b></a>
    06459. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Cellphone Ringtones</b></a>
    07022. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>My Free Credit Report</b></a>
    07652. <a href=http://kverizonringtones.weebly.com/><b>Verizon Kyocera Cell Phone Ringtones</b></a>
    08715. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Thehonorsystem Free Verizon Ringtones</b></a>
    08895. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Download Free Cingular Ringtones</b></a>
  • gravatar
    #21 Gyncfalevencer said on the 2008/06/23 at 06:16
    00882. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Fast Cash Personal Loans</b></a>
    04398. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>School Guaranteed Bank Student Loans Bad Credit</b></a>
    0486. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Bad Credit Long Term Personal Loans</b></a>
    04956. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Guaranteed Unsecured Personal Loan</b></a>
    05353. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Free Composer Ringtones</b></a>
    06466. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Samsung Keypress Ringtones</b></a>
    07040. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Free Government Credit Report</b></a>
    07632. <a href=http://kverizonringtones.weebly.com/><b>Free Ringtones For Verizon Cellular Phones</b></a>
    08764. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Polyphonic Ringtones Verizon Wireless</b></a>
    08839. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Free Download Nokia Ringtones</b></a>
  • gravatar
    #22 Bribrainaniz said on the 2008/06/23 at 14:41
    00841. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Bad Credit Unsecured Personal Loan</b></a>
    04331. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Maine Student Loans For Students With Bad Credit</b></a>
    0483. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Instant Online Guaranteed Approval Personal Loans Bad Credit</b></a>
    04965. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Guaranteed Unsecured Personal Loans</b></a>
    05343. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Free Nokia Ringtones</b></a>
    0649. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Actual Song Ringtones</b></a>
    07016. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Free Yearly Credit Report</b></a>
    07631. <a href=http://kverizonringtones.weebly.com/><b>Free Ringtones For Motorola Verizon</b></a>
    08722. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Coolfreeringtones Verizon Polyphonic Ringtones</b></a>
    08842. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Free Ringtones Download To Pc</b></a>
  • gravatar
    #23 nedGridsininc said on the 2008/06/24 at 05:08
    <a href="http://www.partsprovider.net">HID Kits</a>
    <a href="http://www.partsprovider.net">Car DVD</a>
    <a href=http://www.partsprovider.net>HID Kits</a>
  • gravatar
    #24 Gyncfalevencei said on the 2008/06/24 at 06:49
    00899. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Low Interest Personal Loans</b></a>
    04372. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Credit Card Loan Bad Credit Mortgage Auto Student Business</b></a>
    04875. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Apply Bad Credit Easy Loans Personal</b></a>
    04955. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Unsecured Fixed Rate Personal Loans</b></a>
    05328. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Motorola V60 Free Ringtones</b></a>
    06420. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free No Catch Ringtones</b></a>
    0708. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Consumer Free Credit Report</b></a>
    07614. <a href=http://kverizonringtones.weebly.com/><b>Free Verizon Polyphonic Ringtones</b></a>
    08769. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Ringtones For Verizon Cell Phones</b></a>
    0884. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Motorola Download Free Ringtones</b></a>
  • gravatar
    #25 impuccurbt said on the 2008/06/25 at 01:57
    00884. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Guaranteed Personal Loans</b></a>
    04322. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Free Student Loans With Bad Credit</b></a>
    04894. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Same Day Personal Loans For People With Bad Credit</b></a>
    04988. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Unsecured Personal Loans Bad Credit No Home</b></a>
    05348. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Free Polyphonic Ringtones USA</b></a>
    06440. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free At&T Ringtones</b></a>
    07013. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Linkall Order Free Consumer Credit Report Bureau Check Score</b></a>
    07667. <a href=http://kverizonringtones.weebly.com/><b>Ringtones For Verizon Wireless</b></a>
    08743. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Verizon Music Ringtones</b></a>
    08892. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Samsung Ringtones Free Download Ring Tones For Cell Phone</b></a>

    09374. <a href=http://freenokiaringtones.weebly.com/><b>Download Free Ringtones</b></a>
    0949. <a href=http://downloadfreeringtones.weebly.com/><b>Free Gospel Ringtones</b></a>
    09559. <a href=http://onlyfreemobilephoneringtones.weebly.com/><b>Free Cell Phones Ringtones</b></a>
    09665. <a href=http://freecellphonesringtones.weebly.com/><b>Totally Free Ringtones</b></a>
  • gravatar
    #26 Gyncfalevenceb said on the 2008/06/25 at 08:23
    00878. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Bad Credit Personal Loans</b></a>
    0430. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Student Loans For Students With Bad Credit</b></a>
    0484. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Unsecured Personal Loan Bad Credit</b></a>
    0495. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Personal Credit Hard Money Unsecured Loans</b></a>
    05324. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Free Virgin Mobile Ringtones</b></a>
    06425. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>100% Free Ringtones</b></a>
    07020. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Totally Free Credit Report</b></a>
    07680. <a href=http://kverizonringtones.weebly.com/><b>Verizon Ringback Ringtones</b></a>
    08771. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Free Ringtones For Verizon Wireless Samsung Sch A650 Phones</b></a>
    08846. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Wap Sites To Download Free Samsung Ringtones</b></a>
  • gravatar
    #27 Bribrainanid said on the 2008/06/25 at 12:10
    00833. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Guaranteed Personal Loan Approval</b></a>
    04344. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Private Student Loans For Bad Credit</b></a>
    04814. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Bad Credit Loan Personal Unsecured</b></a>
    04961. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Buy Cheap Unsecured Personal Loans Bad Credit</b></a>
    05392. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Totally Free Ringtones</b></a>
    06497. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Download Nokia Ringtones</b></a>
    07053. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Experian Check Free Credit Report</b></a>
    07687. <a href=http://kverizonringtones.weebly.com/><b>Can You Get Ringtones For A Verizon Camera Phone</b></a>
    08796. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Free Ringtones For Verizon Wireless Customers For Lg Phones</b></a>
    08851. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Download Free Real Music Ringtones</b></a>
  • gravatar
    #28 NepGeannae said on the 2008/06/25 at 12:42
    00810. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Unsecured Bad Credit Personal Loans</b></a>
    04376. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Private Bad Credit Student Loans</b></a>
    04811. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Personal Bad Credit Loan</b></a>
    04942. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Bad Credit Unsecured Personal Loans Online Instantly</b></a>
    05383. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Free Ringtone Converter</b></a>
    06427. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Nokia 5125 Ringtones</b></a>
    07093. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Free Instant Credit Report</b></a>
    07667. <a href=http://kverizonringtones.weebly.com/><b>Verizon Get It Now Ringtones</b></a>
    08757. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Ringtones For Verizon Wireless Phones</b></a>
    08834. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Download Free Mp3 Ringtones</b></a>
    09228. <a href=http://jackwrobertson.tigblog.org/post/388359><b>Totally Free Ringtones</b></a>
  • gravatar
    #29 inipsyApaphq said on the 2008/06/26 at 13:06
    00880. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Very Bad Credit Personal Loans</b></a>
    04317. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Guaranteed Student Loan People Bad Credit</b></a>
    04810. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Secured Personal Loans For People With Bad Credit</b></a>
    04993. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Personal Unsecured Bad Credit Loans</b></a>
    05387. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Free Mp3 Ringtones</b></a>
    0648. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Ringtones For Virgin Mobile</b></a>
    07070. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Free Credit Report No Credit Card Required</b></a>
    07671. <a href=http://kverizonringtones.weebly.com/><b>Polyphonic Ringtones For Verizon Wireless</b></a>
    08739. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Free Verizon Ringtones</b></a>
    08825. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Free Download Free Ringtones</b></a>
    09236. <a href=http://jackwrobertson.tigblog.org/post/388359><b>Keypress Ringtones</b></a>
  • gravatar
    #30 NepGeannaw said on the 2008/06/27 at 00:11
    00839. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Secured Personal Loan</b></a>
    04338. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Bad Debt Loan Student Credit</b></a>
    04822. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Bad Credit Loan Personal Unsecured</b></a>
    04930. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Bad Credit Unsecured Loan Personal Loan</b></a>
    05372. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Mosquito Ringtone</b></a>
    06444. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Mp3 Ringtones</b></a>
    07044. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Free Online Credit Report No Credit Card Needed</b></a>
    07685. <a href=http://kverizonringtones.weebly.com/><b>Coolfreeringtones Verizon Ringtones</b></a>
    08782. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Gospel Ringtones Free Motorola V265 Verizon</b></a>
    08890. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Samsung Ringtones Free Download Ring Tones For Cell Phone</b></a>
    09229. <a href=http://jackwrobertson.tigblog.org/post/388359><b>Free Verizon Ringtones</b></a>
  • gravatar
    #31 NepGeannaz said on the 2008/06/27 at 04:31
    00819. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Guaranteed Online Personal Loans</b></a>
    04332. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Bad College Credit Loan Personal Student</b></a>
    04844. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Bad Credit Long Term Personal Loans</b></a>
    04932. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Bill Consolidation + Unsecured Personal Loan</b></a>
    05352. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Real Sound Ringtones</b></a>
    06455. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Samsung T100 Ringtones</b></a>
    07075. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Government Legislation Free Annual Credit Report</b></a>
    07645. <a href=http://kverizonringtones.weebly.com/><b>Samsung Verizon Ringtones</b></a>
    08722. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Verizon Kyocera Cell Phone Ringtones</b></a>
    08870. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Download Free Ringtones Voicemail Messages</b></a>
    09253. <a href=http://jackwrobertson.tigblog.org/post/388359><b>Free Ringtones Verizon</b></a>
  • gravatar
    #32 Sedendeaxj said on the 2008/06/27 at 08:57
    00823. <a href=http://blogs.ign.com/larrylevasseur/2007/10/02/67857/><b>Second Chance Secured Personal Loan</b></a>
    04342. <a href=http://blogs.ign.com/BadCreditOk/2007/09/20/66790/><b>Free Student Loans With Bad Credit</b></a>
    04856. <a href=http://blogs.ign.com/philvgordon/2008/03/12/83695/><b>Small Bad Credit Personal Loans</b></a>
    04968. <a href=http://blogs.ign.com/charlesbojanen/2008/03/14/83835/><b>Bad Credit Loans Unsecured Personal</b></a>
    05370. <a href=http://blogs.ign.com/robertlnebel/2008/04/01/85550/><b>Ringtones For A Samsung</b></a>
    06417. <a href=http://blogs.ign.com/lorrieacclark/2008/04/22/87440/><b>Free Hip Hop Ringtones</b></a>
    07067. <a href=http://blogs.ign.com/partner55346429/2008/05/06/88882/><b>Free Online Credit Reports With No Credit Card Required</b></a>
    07657. <a href=http://kverizonringtones.weebly.com/><b>Free Ringtones Verizon Wireless Phones</b></a>
    08775. <a href=http://blogs.ign.com/catherinemponder/2008/05/22/90597/><b>Free Verizon Wireless Ringtones</b></a>
    08853. <a href=http://blogs.ign.com/christamstewart/2008/05/22/90599/><b>Thumbplay Free Download Nokia Ringtones</b></a>
    09232. <a href=http://jackwrobertson.tigblog.org/post/388359><b>Free Tracfone Ringtones</b></a>
  • gravatar
    #33 Ed Anderson said on the 2008/07/16 at 17:16
    From looking at this post I assume templates can be created for things like SOAP and REST calls as well? In other words, instead of a template that works on an iPhone, a template could be created to present the sfActions as web services? I may be off the mark a bit (please forgive me, I'm a PM, not a coder...)
  • gravatar
    #34 Lars Gunther said on the 2008/07/20 at 02:54
    UA-sniffing and device specific versions of a website. What year is this? 1997? Haven't you guys heard of Web Standards?

    One may make a site for small screens. But to make a site for a specific device is really bad practice.

    And the iPhone support @media CSS-rules. That should be the first choice if you want to arrange stuff for the small screen. Incidentally that also is supported by Opera and will be by Firefox 3.1 and therefore also Fennec.

    Using the wrong tool for a job is not a good route to go down, even if that tool is really well designed.
  • gravatar
    #35 Hans said on the 2008/07/20 at 08:57
    Lars, what if you want a different html output for the iphone ?
  • gravatar
    #36 Lars Gunther said on the 2008/07/28 at 10:19
    @Hans

    a. If your pages are so bloated that you must use different HTML output I would presume you need serious IA refactoring.

    b. The very point of Apples marketing is that the iPhone should not get mobile specific versions of a website. And they specifically chose not to honor @media handheld but uses @media screen rules. By using such a device a customer has chosen to view the full version. Ergo: use "@media screen and max-width()" if you need to adapt.

    Incidentally, that will also work for all users of Opera Mini (which is a larger audience than the iPhone's!) and Opera Mobile, as well as the upcoming Fennec.

    c. UA sniffing has been proven beyond all reasonable doubt to be a faulty solution. It will only lead to UA-spoofing. We really have been there before! To repeat a previous mistake but expect a different outcome is just plain stupid.

    So:

    If you really must send alternate content to mobile devices (not just the iPhone), the least sucky solution is to use a different URL and let the user choose.

    Of course that can lead to surprises when the mobile version ranks higher on Google. Just like many sites using the faulty approach of having "print versions" experience today.

    But as I said to begin with. If your IA is bad, that is where you should attack the problem. It is better than creating new ones.