25 lines
No EOL
641 B
PHP
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>';
|
|
}
|
|
} |