Answer the question
In order to leave comments, you need to log in
How to correctly form data for a view in MVC?
It is more correct to form an array with data in the controller and pass it to the view, or you can transfer data to the view, and make the following logic in it:
foreach ($variable as $key => $value) {
if ($value['status'] == 1) {
echo "<li>".$value['name']."</li>";
}
}
foreach ($variable as $key => $value) {
echo "<li>".$value['name']."</li>";
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question