定制 doefom/statamic-browser-detect 二次开发

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

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

doefom/statamic-browser-detect

最新稳定版本:v0.1.1

Composer 安装命令:

composer require doefom/statamic-browser-detect

包简介

A Statamic tag as a wrapper for the composer package 'hisorange/browser-detect' (https://github.com/hisorange/browser-detect).

README 文档

README

A Statamic tag as a wrapper for the composer package hisorange/browser-detect (https://github.com/hisorange/browser-detect) to use in your antlers templates.

Features

This addon provides a tag that can be used in antlers templates to find out all sorts of information about the requesting browser, device, operating system and more.

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

composer require doefom/statamic-browser-detect

How to Use

The tag exactly uses the original Browser facade's API. Since all the methods called on the tag are proxied to the Browser facade, you can use the tag like you would use the facade. You can find the documentation here: https://github.com/hisorange/browser-detect#available-api-calls

Examples

In your antlers template you may use the tag like so:

{{ if {browser:isMobile} }}
   <p>It's a mobile device!</p>
{{ /if }}
{{ browser:browserFamily }} // "Chrome" 

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-09