2

This is a question about the architecture.

I've seen two approaches implementing AJAX layer in Zend Framework.

The first one, traditional, using AjaxContext action helper (index.phtml and index.ajax.phtml). This has always a nice fallback when no JavaScript is available.

The second one, implementing separate controllers for AJAX (disable the layout by default etc.)

I wonder about the possible advantages and drawbacks of those two solutions in the long run.

Which one would you recommend and why?

(I'm using ZendX jQuery)

Charles
  • 50,943
  • 13
  • 104
  • 142
takeshin
  • 49,108
  • 32
  • 120
  • 164

1 Answers1

0

I would only implement different controller actions if they had to do something different at that level. Rendering a specific view based on the request method is not cause for a new action method.

My vote goes to AjaxContext.

Phil
  • 157,677
  • 23
  • 242
  • 245