2009年8月18日星期二

Re: [fw-mvc] AJAX, Basic HTML and Zend MVC

I prefer to take a different approach and use "progressive enhancement" to make an existing page more usable. Take a look at this article for more information:


The idea is to create a basic, working page in plain HTML (which it sounds like you already have). Then, using Javascript to detect the browser's Javascript and/or CSS abilities, you can improve the user interface up to the browser's potential.

This can help keep development time/costs down by maintaining only one application. If the user visits your page on a mobile phone. gaming console (Wii, PS3, etc), or simply has Javascript disabled, they will always have access to a fully-functional site.

You can always give the user the option to "downgrade" to a less-fancy version of the site by providing a link somewhere on the page which, when clicked, tells you application to not use the fancy javascript/css. To accomplish this in ZF, I've used an early-running front controller plugin that checks the request for a special parameter like enhanced = yes/no. If the parameter is found, the plugin enables/disables the features and redirects the user to the same page (but without the parameter).

--
Hector


On Tue, Aug 18, 2009 at 9:46 PM, Jojogoogoo <jojogoogoo@gmail.com> wrote:

Hello Nabble community,

I am currently developing an application and re-creating the interface to
use more javascript controls and other cool features. The application
already has an existing user interface, functional, very usable.

I wanted to change the entire interface, add some Dijit Layout containers,
etc. This would mean that I would recreate my Zend Layout scripts and change
all my view files to work with these changes.

I can imagine that a lot of controller code would also be touched, just to
handle sending and receiving data in JSON for example.

I would like to hear the opinions and approaches of other Zend Framework
users in determining how one could, for example, provide the end user with a
login and the option to select the "Advanced HTML" or "Basic HTML" versions
of the same interface.

Would one, for example, create a separate MVC application and separate all
common code into classes? (Which should be done anyway). Then would you
rewrite the router based on their login preference?

Perhaps you'd prefer to keep the controllers intact and just change the view
scripts? (The point of MVC :) ). If that's the case, would you make a custom
viewRenderer to choose the correct view script? E.g. index.phtml or
index-ajax.phtml or index-iphone.phtml?

I hope I've explained it well enough, sorry to be dragging this on :)

Thanks in advance!
--
View this message in context: http://www.nabble.com/AJAX%2C-Basic-HTML-and-Zend-MVC-tp25037711p25037711.html
Sent from the Zend MVC mailing list archive at Nabble.com.


没有评论: