webfiler/application/views/helpers/ProfileLink.php
2015-09-29 16:59:45 +00:00

17 lines
531 B
PHP

<?php
class Zend_View_Helper_ProfileLink extends Zend_View_Helper_Abstract
{
public function profileLink()
{
$auth = Zend_Auth::getInstance();
if ($auth->hasIdentity()) {
$username = $auth->getIdentity()->username;
$logoutUrl = $this->view->url(array(
'controller' => 'user',
'action' => 'logout'
), null, true);
return '<a href="'.$logoutUrl.'" title="Se déconnecter" class="navbar-link">Déconnexion : ' . $username . '</a>';
}
}
}