I am read about MVC pattern, that whole php logic must be in model, but when we have situation like this: from model passed mysqli_result object to view and in view we need check value from some column (mysql table column) and print something according to this value, that is in view we have:
while ($row = $my_mysqli_result_object->fetch_assoc()) {
if ($row['some_column'] == "1") {
// print something
}
else if ($row['some_column'] == "2") {
// print something other
}
else if ($row['some_column'] == "3") {
// print something other
}
// ....
// ....
}
As you see, in view is php logic (few logic , but exists).
My question is: this dose of php logic in view, normally for MVC concept ? or this is not right way for MVC and must do something other, in such situations?
In MVC pattern all the logic is in the controller, not in the model.
The model usually carry only the data. It could verify data correctness (that’s the only elaboration delegated to the model).
The view can do few elaboration – i.e. it can have a little bit of logic inside – but only if it is related to the presentation aspect.
Answering to your question: this dose of php logic in view is absolutely normal and acceptable.