resist / device
Simple mobile detector for Symfony + Twig
Installs: 2 058
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/resist/device
Requires
- php: ^8.2
- symfony/http-foundation: ^5.4|^6.0|^7.0
- twig/twig: ^3.3
README
Simple mobile detector for Symfony + Twig
github.com/resist/device
© resist
Light-weight tool for mobile detection, not for 100% hit rate. Mobile detection based on Fat Free Framework's Audit class.
Install:
composer require resist/device
Usage
Use Device as injected service and call isMobile(): bool.
Register optinal Twig is_mobile() function as extension:
# config/service.yaml resist\Device\Device: resist\Device\TwigDevice: tags: [ 'twig.extension' ]