backend2-plus/is-mobile-bundle
最新稳定版本:1.1.0
Composer 安装命令:
composer require backend2-plus/is-mobile-bundle
包简介
Check if site is started on Mobile or not
README 文档
README
INSTALL:
composer req backend2-plus/is-mobile-bundle
Simple code for detecting device.
USE IN CONTROLLER:
use IsMobile\IsMobileBundle\IsMobile; #[Route('/', name: 'app_home')] public function index(IsMobile $isMobile): JsonResponse { return $this->json([ 'isMobile' => $isMobile->isMobile() ]); }
USE IN TWIG:
config/packages/twig.yaml:
globals:
isMobileHelper: '@IsMobile\IsMobileBundle\IsMobile'
and you can use in twig template:
{% if isMobileHelper.IsMobile %}
{% endif %}
统计信息
- 总下载量: 405
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-07-26