Archived
1
0
Fork 0
This repository has been archived on 2026-05-10. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
fiktivkod/library/Fiktiv/View/Helper/AuthLink.php
2010-09-11 22:15:20 +02:00

25 lines
No EOL
641 B
PHP

<?php
class Fiktiv_View_Helper_AuthLink extends Zend_View_Helper_Abstract
{
public function authLink()
{
$auth = Zend_Auth::getInstance();
$options = array(
'route' => 'default',
'module' => 'default',
'controller' => 'auth'
);
if ($auth->hasIdentity()) {
$options['action'] = 'logout';
$display = 'u:logout';
} else {
$options['action'] = 'login';
$display = 'u:login';
}
return '<a href="' . $this->view->url($options) . '">' . $this->view->translate($display) . '</a>';
}
}