17 lines
509 B
PHP
17 lines
509 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.'" alt="Se déconnecter">Déconnexion : ' . $username . '</a>';
|
||
|
}
|
||
|
}
|
||
|
}
|