Newbie question about MVC structures here. So in an MVC, I currently have a page in my Views to display a list of results from a database query, in this bit of code I instantiate a class, run a method for sql query, and at last there's a for each loop and then displaying it with divs.
So my question is, if this bit of code is considered business logic and should be in a method in the Model, or is it part of the Views?
I hope you understand what I mean =) Thanks!
$listholder = new Categories_Model(); 
$data = $listholder->getCategories();
       $i = 1;
        foreach ($data as $row) {
            if ($i & 1) {
                echo '<div id="horizontalContainer" style="float: none; height: 50px";>';
                echo '<div id="listoverview1"><a href="'.URL.'categories/show/'.$row['id'].'">'.$row['catname'].'</a>';
                echo '</div>';
            } else {
                echo '<div id="listoverview1"><a href="'.URL.'categories/show/'.$row['id'].'">'.$row['catname'].'</a>';
                echo '</div></div>';
            }
            $i++;
       }
 
     
     
     
    