2 /* This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
3 and is published under the AGPL license. */
5 class Syj_View_Helper_Anchor extends Zend_View_Helper_HtmlElement
7 public function Anchor($href, $text = null, array $attribs=array(), $escape = true) {
8 $lang = Zend_Controller_Front::getInstance()->getRequest()->getQuery('lang');
10 $translator = Zend_Registry::get('Zend_Translate');
11 $adapter = $translator->getAdapter();
12 if ($adapter->isAvailable($lang)) {
13 $href = $this->view->addParamToUrl($href, 'lang', $lang);
17 $attribs = array_merge(array('href' => $href), $attribs);
21 $content = $escape ? $this->view->escape($text) : $text;
22 $html = '<a' . $this->_htmlAttribs($attribs) . '>' . $content . '</a>';