A
A
Anton2016-08-31 15:04:37
Yii
Anton, 2016-08-31 15:04:37

What is the best way to make a view (MVC)?

Hello. I have two actions that do the same thing only with different data, and their views are slightly different, mainly in color in some places. How can I make one view and pass a bunch of parameters there, or two different views?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Fedorov, 2016-08-31
Reytarovsky @Antonchik

if actions do the same thing - then it's worth considering whether it makes sense to separate them at all. In this situation, it is better to make one action and one view, although of course you need to look at the code what is happening there and how logical it will be

C
crazyhat, 2016-08-31
@crazyhat

Through actions, pass the css class depending on the action. In view'he to deduce in a tag a certain class. I did.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question