diff --git a/library/Fiktiv/View/Helper/BrowserString.php b/library/Fiktiv/View/Helper/BrowserString.php new file mode 100644 index 0000000..db5ef95 --- /dev/null +++ b/library/Fiktiv/View/Helper/BrowserString.php @@ -0,0 +1,56 @@ +getDevice()->getBrowserVersion()); + return implode('.', array_slice($parts, 0, 2)); + } + + /** + * Constructor + * + * Constructs and stores the browser string to + * later be retrieved by the helper method. + * + * @return void + */ + public function __construct() + { + // Construct the string. + $httpAgent = new Zend_Http_UserAgent(); + + $this->_info = $httpAgent->getDevice()->getBrowser() . " " + . $this->_getVersion($httpAgent); + } + + /** + * The Actual helper method. + * + * @return string + */ + public function browserString() + { + return $this->_info; + } +}