Correction de bugs
This commit is contained in:
@@ -9,16 +9,16 @@ class Albums extends CI_Controller {
|
||||
// Load the URL Helper
|
||||
$this->load->helper('url');
|
||||
}
|
||||
public function index($page = 1){
|
||||
public function index(){
|
||||
$page = 1;
|
||||
$limit = 21;
|
||||
$offset = ($page - 1) * $limit;
|
||||
$albums = $this->model_music->getAlbums($limit, $offset);
|
||||
|
||||
// Pass pagination information to view
|
||||
$total_albums = $this->model_music->get_total_albums();
|
||||
$data['total_pages'] = ceil($total_albums / $limit);
|
||||
$data['current_page'] = $page;
|
||||
$data['albums'] = $albums; // Pass albums data to view
|
||||
$data['albums'] = $albums;
|
||||
|
||||
$this->load->view('layout/header_not_logged_dark');
|
||||
$this->load->view('albums_list', $data);
|
||||
|
@@ -5,11 +5,15 @@ public function index() {
|
||||
// Charger le modèle
|
||||
$this->load->model('Cover_model');
|
||||
|
||||
$this->load->helper('url');
|
||||
|
||||
// Appeler la fonction pour récupérer les couvertures d'albums
|
||||
$data['covers'] = $this->Cover_model->get_covers();
|
||||
|
||||
// Charger la vue avec les données récupérées
|
||||
$this->load->view('layout/header_not_logged_dark');
|
||||
$this->load->view('accueil', $data);
|
||||
$this->load->view('layout/footer_dark');
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user