2013-11-05 11:18:30 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Zend_View_Helper_ProfileLink extends Zend_View_Helper_Abstract
|
|
|
|
{
|
2016-11-29 15:10:11 +01:00
|
|
|
public function profileLink()
|
|
|
|
{
|
|
|
|
$auth = Zend_Auth::getInstance();
|
2013-11-05 11:18:30 +00:00
|
|
|
if ($auth->hasIdentity()) {
|
|
|
|
$username = $auth->getIdentity()->username;
|
|
|
|
$logoutUrl = $this->view->url(array(
|
2016-11-29 15:10:11 +01:00
|
|
|
'controller' => 'user',
|
|
|
|
'action' => 'logout'
|
2013-11-05 11:18:30 +00:00
|
|
|
), null, true);
|
2013-11-05 13:13:59 +00:00
|
|
|
return '<a href="'.$logoutUrl.'" title="Se déconnecter" class="navbar-link">Déconnexion : ' . $username . '</a>';
|
2013-11-05 11:18:30 +00:00
|
|
|
}
|
2016-11-29 15:10:11 +01:00
|
|
|
}
|
|
|
|
}
|