geniv/nette-user-agent

User agent extension for Nette Framework

v1.0.1 2018-10-19 09:52 UTC

This package is auto-updated.

Last update: 2020-09-19 16:14:31 UTC


README

via: http://www.useragentstring.com/

Installation

$ composer require geniv/nette-user-agent

or

"geniv/nette-user-agent": ">=1.0.0"

require:

"php": ">=7.0.0",
"nette/nette": ">=2.4.0"

Include in application

neon configure extension:

extensions:
    - UserAgent\Bridges\Nette\Extension

usage UserAgent:

UserAgent::isFirefox()
UserAgent::isChrome()
UserAgent::isSafari()
UserAgent::isOpera()
UserAgent::isIExplorer()
UserAgent::isAndroid()
UserAgent::isLinux()
UserAgent::isMac()
UserAgent::isWindows()
UserAgent::isWebKit()
UserAgent::isGecko()

usage UserAgentString:

UserAgentString::getData()
UserAgentString::isLinux()
UserAgentString::isMac()
UserAgentString::isWindows()
UserAgentString::isChrome()
UserAgentString::isSafari()
UserAgentString::isFirefox()
UserAgentString::isOpera()
UserAgentString::isAndroid()
UserAgentString::isIExplorer()
UserAgentString::isBrowser(['Chrome', 'Firefox', 'Internet Explorer'], agent)
UserAgentString::isOs(['Linux', 'Windows', 'Macintosh'], agent)
UserAgentString::getOs()
UserAgentString::getBrowser()
UserAgentString::isWebKit()
UserAgentString::isGecko()

note: in offline mode use UserAgent, in development mode use static variable, in production mode use nette cache