Hi
The task is to take the data from the database, rework them and give them to the view. How to do it?
$sql = "SELECT * FROM table ";
$query = $this->db->query(sql) ;
$items = $query->fetchAll();
$new_items = array();
foreach($items as $i) {
...
$i["values"] = "new val";
...
$new_items[] = $i;
}
$new_result = ???????? ($new_items);
$result = new Resultset(null, new Models, $new_result);
$paginator = new Paginator([
"data" => $result,
"limit" => 10,
"page" => 1
]);