S
S
Sergey2015-09-17 23:59:43
Yii
Sergey, 2015-09-17 23:59:43

Is it normal to make a site on Yii with only widgets?

I am doing a project on Yii1, a kind of task manager like Bitrix24 or Megaplan. So, there are many functional blocks on the pages, for example: a calendar, filters, directors, comments, statuses, history, etc. Almost all functionality works on ajax requests. When I did everything, my controllers were overflowing with actions and various methods, and as a result of the fact that the TK was invented on the go, also with crutches. Of course, I tried to divide everything into separate blocks, components, classes. Bottom line: difficult, not beautiful, crutches, a lot of dependencies.
He began to correct the situation, began to make all the blocks into widgets. My widgets have their own resources - js, css, img, and even their own actions (I included from the controller) for ajax requests, and I tied the connections of some blocks with others on js events. In the end, everything became simple and clear. Carried away by this idea, I transferred almost the entire project to widgets.
Question. Am I doing the right thing? (please comment)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-09-18
Protko @Fesor

HMVC is OK, but not in the way it is done in Yii1. In any case, if this option is understandable, easier to maintain and less connected, then yes, everything is fine, that's how it should be. If your page consists of independent widgets, it is logical to do this as separate components.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question