resist / device
Simple mobile detector for Symfony + Twig
1.0.3
2024-01-03 14:42 UTC
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' ]