User agent
via: http://www.useragentstring.com/, (*1)
Installation
$ composer require geniv/nette-user-agent
or, (*2)
"geniv/nette-user-agent": ">=1.0.0"
require:, (*3)
"php": ">=7.0.0",
"nette/nette": ">=2.4.0"
Include in application
neon configure extension:, (*4)
extensions:
- UserAgent\Bridges\Nette\Extension
usage UserAgent:, (*5)
UserAgent::isFirefox()
UserAgent::isChrome()
UserAgent::isSafari()
UserAgent::isOpera()
UserAgent::isIExplorer()
UserAgent::isAndroid()
UserAgent::isLinux()
UserAgent::isMac()
UserAgent::isWindows()
UserAgent::isWebKit()
UserAgent::isGecko()
usage UserAgentString:, (*6)
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, (*7)