Modules - Widget - Ajax Design Where and the how

Have have looked for days on this question and really found nothing that answers my questions, being fairly new to YII, I am sure I am looking at this problem all wrong.

Le Problem

I have a module with multiple controllers / views for a large form (not my choice :)). I have one file called “EditForm” that makes a bunch of ajax calls to all of the smaller forms (address info, sales record, history…).

The reason I broken this down into smaller controllers / views is that each of these pieces addresses a seperate DB issue + has allot of backend programming / logic for the information itself. ALSO, each of these pieces of the form will / could be used later individually and the look would be the same. (Address info, sales record, history (multiple records)… all reusable).

The Nut of of

Each of these individual pieces will have smaller pieces, example sales history will also require a ajax popup window to add / edit the history, add notes and so forth.

Finally the Widget Issue

I would like to turn these into widgets. But many some of these items I am going to have to create multiple pages for in a another controller just to display them.

Ultimately, I would like to be able to include these items as widgets independently on a page, but how do I deal with some of these items that are going to generate ajax calls and open forms without having to write seperate actions in another controller every time I use the widget.


I am wandering if anyone has suggestions on a design / usage that would better fit this problem.

Some options I considered

I could add widgets to my module that use some of the controller/action/view items.

But to do this with a widget, I would have to make a page from the view with only code that calls the widget(which just adds more pages for debugging).

It would not be bad if from within my modules controller I could render the widgets, which includes the assets. But unless the widget is rendered in a view, my assets are not included.

For the ajax calls I have to call a view to call a widget?? Why? I have got to be missing something here.