Hi,

it's basically really just a question of view.

Here's an old blog post about creating an iphone view:
http://www.symfony-project.org/blog/2008/06/09/how-to-create-an-optimized-version-of-your-website-for-the-iphone-in-symfony-1-1
Most of it is still valid and it works.

But there is one serious drawback: You have to provide a mobile
template for each action.
That's why we created a tiny patch (for our "ullright" platform) to
provide a fallback to normal templates in case there is no special
mobile one.

Here are the required parts:

Mobile detection: This belongs into your project configuration:
http://trac.ullright.org/browser/trunk/plugins/ullCorePlugin/config/ullCorePluginConfiguration.class.php

Symfony patch enabling fallback to html templates: (Patches
sfView.class.php)
http://trac.ullright.org/browser/trunk/plugins/ullCorePlugin/patch/sfView.patch.txt

Finally provide a mobile template (or not):
Normaly you would put your template in apps/frontend/modules/myModule/
templates/myActionSuccess.php
Now you can provide a mobile template by creating the following file:
apps/frontend/modules/myModule/templates/myActionSuccess.mobile.php

This also works for layouts, partials and components. Example: apps/
frontend/modules/myModule/templates/_head.mobile.php

Have a nice day,

Klemens





On 6 Sep., 00:29, Alexandre Salomé <alexandre.sal...@gmail.com> wrote:
> It's just a question of view.
>
> You should create dedicated routes with a sf_format "mini"
>
> 2010/9/2 Dennis <gear...@sbcglobal.net>
>
>
>
> > Rather than go the plugin route, why not use either a '.mobi' tld, or
> > '.movi' subdomain, and symlinnk any directories that you need between
> > the two projects?
>
> > On Sep 1, 4:57 am, Benoit Montuelle <benoit.montue...@gmail.com>
> > wrote:
> > > I've done it by adding specific layout, templates and stylesheet to the
> > existing app.
>
> > > You can trigger events in your project configuration upon user agent to
> > change templates and specific configuration.
>
> > > The strategy to use another app depends wether your mobile app should
> > have the same functionnality as the 'classic' web app does, but it will be
> > easier if most code still shared.
>
> > > -----Original Message-----
> > > From: Kevin <kevinb...@gmail.com>
> > > Sent: mercredi 1 septembre 2010 12:51
> > > To: symfony users <symfony-users@googlegroups.com>
> > > Subject: [symfony-users] mobile site strategy
>
> > > I am wondering what others have done to create a mobile site for their
> > > symfony projects (when more than just a handheld stylesheet is
> > > required).
>
> > > What I am planning on doing is moving all my modules to a plugin and
> > > creating another app called 'mobile'.  I can then override any modules
> > > I need optimized for a mobile device.
>
> > > What strategies have you come up with?  Is there an agreed upon best
> > > practice?
>
> > > --
> > > If you want to report a vulnerability issue on symfony, please send it to
> > security at symfony-project.com
>
> > > You received this message because you are subscribed to the Google
> > > Groups "symfony users" group.
> > > To post to this group, send email to symfony-users@googlegroups.com
> > > To unsubscribe from this group, send email to
> > > symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> > > For more options, visit this group athttp://
> > groups.google.com/group/symfony-users?hl=en
>
> > --
> > If you want to report a vulnerability issue on symfony, please send it to
> > security at symfony-project.com
>
> > You received this message because you are subscribed to the Google
> > Groups "symfony users" group.
> > To post to this group, send email to symfony-users@googlegroups.com
> > To unsubscribe from this group, send email to
> > symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/symfony-users?hl=en
>
> --
> Alexandre Saloméhttp://alexandre-salome.fr

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to