Bouton déconnexion
This commit is contained in:
parent
775bc341df
commit
8e760c0dc6
application
@ -15,7 +15,7 @@ class Albums extends CI_Controller {
|
||||
'albums' => $albums,
|
||||
'is_logged_in' => $is_logged_in
|
||||
);
|
||||
$this->load->view('layout/header',$data);
|
||||
$this->load->view('layout/header',$is_logged_in);
|
||||
$this->load->view('albums_list', $data);
|
||||
$this->load->view('layout/footer');
|
||||
}
|
||||
|
@ -1,14 +1,6 @@
|
||||
<h5>Albums list</h5>
|
||||
<section class="list">
|
||||
|
||||
<?php if (isset($is_logged_in) && $is_logged_in): ?>
|
||||
<h1>Connecté</h1>
|
||||
<a href="<?= site_url('connect/logout') ?>">Déconnexion</a>
|
||||
<?php else: ?>
|
||||
<h1>Non connecté</h1>
|
||||
<a href="<?= site_url('connect/login') ?>">Connexion</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
foreach($albums as $album){
|
||||
echo "<div><article>";
|
||||
|
@ -20,9 +20,11 @@
|
||||
<li><?= anchor('albums', 'Albums'); ?></li>
|
||||
<li><?= anchor('artistes', 'Artistes'); ?></li>
|
||||
<li><?= anchor('playlist', 'Playlist'); ?></li>
|
||||
<?php if ($this->session->userdata('user_id')): ?>
|
||||
<?php if (isset($is_logged_in) && $is_logged_in): ?>
|
||||
<h1>Connecté</h1>
|
||||
<li><?= anchor('connect/logout', 'Déconnexion'); ?></li>
|
||||
<?php else: ?>
|
||||
<h1>Non connecté</h1>
|
||||
<li><?= anchor('connect/login', 'Connexion'); ?></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
Loading…
x
Reference in New Issue
Block a user