two foreach connect |
Hello everyone,
I have a question. In my website I often have to link two different "foreach". I usually do it like this PHP Code: foreach ($view_category_main as $main): Now i wonder if there is a more elegant way to store it in modal and then have it retrieved?
If you follow the model-view-controller pattern, the database query should be in a model and the output should in a view.
You could do something like this: MODEL PHP Code: // Add & in front of $main VIEW PHP Code: foreach ($view_category_main as $main): |
Welcome Guest, Not a member yet? Register Sign In |