Forums / Developer / server variable / Comment66134

Author Topic

Thiago Campos Viana

Wednesday 23 February 2011 5:48:15 am

Comment66134

Hello and welcome, I don't know if there's a template operator that returns it, but I created an operator that returns the user browser info:

http://ezextensions.googlecode.com/files/get_browser.zip

Usage: {get_browser()|attribute(show,1)}

Enable it in admin interface, regenerate autoloads and clear the cache.

If you really want $_SERVER['HTTP_USER_AGENT'] you could change modify function in getbrowseroperator.php to:

function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement )
{          
          $operatorValue=$_SERVER['HTTP_USER_AGENT']; 

}

PS.: I've just read self Nacer answear, just use that.

eZ Publish Certified Developer: http://auth.ez.no/certification/verify/376924

Twitter: http://twitter.com/tcv_br