netbull / mobile-detect-bundle
Symfony 4/5/6 扩展包,用于检测移动设备,管理移动视图类型,重定向到移动版本。
v5.2.0
2022-07-07 07:55 UTC
Requires
- php: ^7.2 || ^8.0 || ^8.1
- mobiledetect/mobiledetectlib: ^2.8
- symfony/framework-bundle: ^4.4|^5.0|^6.0
- twig/twig: 2.*|3.*
Requires (Dev)
- php-coveralls/php-coveralls: ^2.0.0
- phpunit/phpunit: ^8.4|^9.0
- symfony/phpunit-bridge: ^4.4|^5.0|^6.0
README
MobileDetectBundle
Symfony 4/5/6 扩展包,用于检测移动设备,管理移动视图并重定向到移动和平板电脑版本。
简介
本扩展包使用 Mobile_Detect 类,并提供以下功能
- 通过名称、操作系统、浏览器用户代理检测各种移动设备
- 管理不同移动设备的网站视图(
mobile
、tablet
、full
) - 重定向到移动和平板电脑网站
安装
-
通过 composer 安装最新版本
composer require netbull/mobile-detect-bundle --dev
-
如果您不使用 Symfony Flex,则必须手动在应用程序中启用此扩展包
// config/bundles.php // in older Symfony apps, enable the bundle in app/AppKernel.php return [ // ... SunCat\MobileDetectBundle\MobileDetectBundle::class => ['dev' => true], ];
文档
大部分文档存储在此扩展包中的 Resources/doc/index.md
文件中
许可证
本扩展包遵循 MIT 许可证。请参阅扩展包中的完整许可证
Resources/meta/LICENSE