定制 digifa/mobile-detect-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

digifa/mobile-detect-bundle

最新稳定版本:v2.3.2.4

Composer 安装命令:

composer require digifa/mobile-detect-bundle

包简介

Symfony 6.4, 7.0 / PHP 8.2 bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.

README 文档

README

Mobile Detect

MobileDetectBundle

Symfony 6.4.x / PHP 8.2 bundle to detect mobile devices, manage mobile view and redirect to the mobile and tablet version.

Github Actions Status codecovLatest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

This bundle is a fork of tattali/MobileDetectBundle that is a fork of suncat2000/MobileDetectBundle. As this project doesn't look maintained anymore, we decided to create & maintain a fork. For more information read our manifest.

Introduction

This Bundle use Mobile_Detect class and provides the following features:

  • Detect the various mobile devices by Name, OS, browser User-Agent
  • Manages site views for the various mobile devices (mobile, tablet, full)
  • Redirects to mobile and tablet sites

Documentation

Installation

composer require tattali/mobile-detect-bundle

Install with Symfony legacy versions: here

Usage

Checking device

use MobileDetectBundle\DeviceDetector\MobileDetectorInterface;

public function someaction(MobileDetectorInterface $mobileDetector)
{
    $mobileDetector->isMobile();
    $mobileDetector->isTablet();
    $mobileDetector->is('iPhone');
}

With Twig

{% if is_mobile() %}
{% if is_tablet() %}
{% if is_device('iPhone') %} # magic methods is[...]

Switch device view

For switch device view, use device_view GET parameter:

http://localhost:8000?device_view={full/mobile/tablet}

Or using the Symfony toolbar mbd-bundle-sf-toolbar

Going further

Contribute and feedback

Any feedback and contribution will be very appreciated.

License and credits

This bundle is under the MIT license. See the complete license in the bundle

Original authors: tattali, suncat2000, HenriVesala, netmikey and all contributors

统计信息

  • 总下载量: 195
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 155
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-10-16