2009年8月21日星期五

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

Similar to Hector's answer, there is a lot you can do to enhance without
creating multiple instances of your site. For example in your JS code
you can test for capabilities inline with your scripts, such as before
you add event handlers to various items. If you follow unobtrusive JS
(wiki that term) principles it is actually very easy. You have to do
this anyway for the quirks of IE vs Firefox...

An example I have done is supporting older BB browsers which have some
but very limited JS support. Even something like change/onChange doesn't
work. So next to my drop downs which normally have an change/onChange
handler attached to them, I put a submit button. In my JS I test for the
ability to support an event listener, and if so, I attach the event
listener to sumbit on change. In my script I also remove the button, to
keep a nice cleaner look and feel for those with more capable browsers.

Unless you are doing something super advanced, you should be able to
overlay your JS code in such a way as to allow you to use the same views
as before.


--Seth

-----Original Message-----
From: Jojogoogoo [mailto:jojogoogoo@gmail.com]
Sent: Tuesday, August 18, 2009 11:46 PM
To: fw-mvc@lists.zend.com
Subject: [fw-mvc] AJAX, Basic HTML and Zend MVC


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-tp25037711p2503771
1.html

Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: