public function getColorDetail($id) { $c = new Color(); $result = $c->getVotes($id)->fetch(); $votes = $result[0] === null ? 0 : $result[0]; header('Content-Type: application/json'); echo json_encode(['votes' => $votes]); }
public function show() { $c = new Color(); $list = $c->all(); include 'Libraries/Views/list.php'; }