{"id":16798884,"url":"https://github.com/sjelfull/craft3-mobiledetect","last_synced_at":"2025-03-17T03:31:05.267Z","repository":{"id":57061890,"uuid":"109604889","full_name":"sjelfull/craft3-mobiledetect","owner":"sjelfull","description":"Use Mobile_Detect for detecting mobile devices (including tablets)","archived":false,"fork":false,"pushed_at":"2023-10-24T13:53:43.000Z","size":24,"stargazers_count":19,"open_issues_count":3,"forks_count":2,"subscribers_count":1,"default_branch":"v2","last_synced_at":"2025-03-12T05:22:57.673Z","etag":null,"topics":["craft","craft-plugin","craft3","craftcms","craftcms-plugin"],"latest_commit_sha":null,"homepage":"https://superbig.co","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sjelfull.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-05T18:29:00.000Z","updated_at":"2024-01-30T18:19:02.000Z","dependencies_parsed_at":"2024-10-27T11:57:17.756Z","dependency_job_id":"3cf45012-7eb3-4eaf-8c11-fb27627e4e84","html_url":"https://github.com/sjelfull/craft3-mobiledetect","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":0.09090909090909094,"last_synced_commit":"826868efe3dbe9f74e540e4414deaa3d50477af4"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2Fcraft3-mobiledetect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2Fcraft3-mobiledetect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2Fcraft3-mobiledetect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2Fcraft3-mobiledetect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjelfull","download_url":"https://codeload.github.com/sjelfull/craft3-mobiledetect/tar.gz/refs/heads/v2","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243841204,"owners_count":20356441,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["craft","craft-plugin","craft3","craftcms","craftcms-plugin"],"created_at":"2024-10-13T09:27:11.265Z","updated_at":"2025-03-17T03:31:04.934Z","avatar_url":"https://github.com/sjelfull.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MobileDetect plugin for Craft CMS 3.x\n\nUse Mobile_Detect for detecting mobile devices (including tablets)\n\n![Screenshot](resources/img/icon.png)\n\n## Requirements\n\nThis plugin requires Craft CMS 3.0.0-beta.23 or later.\n\n## Installation\n\nTo install the plugin, follow these instructions.\n\n1. Open your terminal and go to your Craft project:\n\n        cd /path/to/project\n\n2. Then tell Composer to load the plugin:\n\n        composer require superbig/craft3-mobiledetect\n\n3. In the Control Panel, go to Settings → Plugins and click the “Install” button for MobileDetect.\n\n## MobileDetect Overview\n\nfairly complete wrapper for the [Mobile_Detect](http://mobiledetect.net/) library by [@serbanghita](https://github.com/serbanghita).**\n\n## Using MobileDetect\n\nThe plugin exposes most of Mobile_Detect's methods, and can be used in your Twig:\n\n```twig\n{{ craft.mobileDetect.isMobile ? 'I am mobile.' : 'I am not mobile.' }}\n```\n\n...or as a PHP service:\n\n```php\n\u003c?php\n$isMobile = MobileDetect::$plugin-\u003emobileDetect-\u003eisMobile();\n```\n\n## Methods/usage\n\n### Device detection\n```twig\nisMobile\n```\n_Detects all mobile devices, both phones and tablets_\n\n```twig\nisTablet\nisPhone\n```\n\n### Mobile OS detection\n```twig\nisiOS\nisAndroidOS\nisBlackBerryOS\nisPalmOS\nisSymbianOS\nisWindowsMobileOS\nisWindowsPhoneOS\n```\n\n### Other methods\n\n```twig\nis(key)\n```\n_Test for anything, e.g. ```is('iphone')```_\n\n```twig\nmatch(pattern)\n```\n_Test using regular expressions_\n\n```twig\nversion(component)\n```\n_Get the version of a component, e.g. ```version('iPhone')```_\n\n```twig\nmobileGrade\n```\n_Get browser grade (e.g. \"A\")_\n\n```twig\ngetScriptVersion\n```\n_Prints the MobileDetect library's version_\n\n```twig\ngetUserAgent\nsetUserAgent(userAgent)\ngetMobileHeaders\ngetHttpHeaders\nsetHttpHeaders(httpHeaders)\ngetCfHeaders\nsetCfHeaders(cfHeaders)\n```\n\nBrought to you by [Superbig](https://superbig.co)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjelfull%2Fcraft3-mobiledetect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjelfull%2Fcraft3-mobiledetect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjelfull%2Fcraft3-mobiledetect/lists"}