PHP Classes

File: views/shared/_login.php

Recommend this page to a friend!
  Classes of Aleksey  >  PHP Framework Bootstrap 4 Template  >  views/shared/_login.php  >  Download  
File: views/shared/_login.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Framework Bootstrap 4 Template
Show application pages using Bootstrap templates
Author: By
Last change:
Date: 9 months ago
Size: 546 bytes
 

Contents

Class file image Download
<?php
$session
= PhpMvc\View::getHttpContext()->getSession();

echo
'<ul class="navbar-nav navbar-right">';

if (empty(
$session['user'])) {
    echo
'<li class="nav-item">' . PhpMvc\Html::actionLink('Log in', 'index', 'account', null, array('class' => 'nav-link')) . '</li>';
}
else {
    echo
'<li class="nav-item"><span class="navbar-text">Hello, ' . $session['user'] . '!</span></li>';
    echo
'<li class="nav-item">' . PhpMvc\Html::actionLink('Log out', 'logout', 'account', null, array('class' => 'nav-link')) . '</li>';
}

echo
'</ul>';
?>

For more information send a message to info at phpclasses dot org.