{"id":16266481,"url":"https://github.com/thormeier/mobiledetectlightbundle","last_synced_at":"2026-01-21T12:34:48.658Z","repository":{"id":15530936,"uuid":"18265526","full_name":"thormeier/MobileDetectLightBundle","owner":"thormeier","description":"Symfony2 bundle for easy usage of mobiledetect class in Twig http://mobiledetect.net/","archived":false,"fork":false,"pushed_at":"2014-03-31T09:49:11.000Z","size":248,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T11:19:49.882Z","etag":null,"topics":["symfony2-bundle","twig","twig-functions"],"latest_commit_sha":null,"homepage":null,"language":null,"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/thormeier.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-30T14:22:56.000Z","updated_at":"2014-03-31T09:49:11.000Z","dependencies_parsed_at":"2022-09-06T17:21:10.571Z","dependency_job_id":null,"html_url":"https://github.com/thormeier/MobileDetectLightBundle","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thormeier%2FMobileDetectLightBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thormeier%2FMobileDetectLightBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thormeier%2FMobileDetectLightBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thormeier%2FMobileDetectLightBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thormeier","download_url":"https://codeload.github.com/thormeier/MobileDetectLightBundle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247866126,"owners_count":21009238,"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":["symfony2-bundle","twig","twig-functions"],"created_at":"2024-10-10T17:42:08.778Z","updated_at":"2026-01-21T12:34:48.620Z","avatar_url":"https://github.com/thormeier.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"MobileDetectLightBundle\n=======================\n\n[![Build Status](https://travis-ci.org/thormeier/MobileDetectLightBundle.png?branch=master)](https://travis-ci.org/thormeier/MobileDetectLightBundle)\n\n## Introduction\n\nThis Symfony2 bundle provides three twig functions to check if the client is on a mobile or tablet device. This bundle makes use of the class provided by http://mobiledetect.net/.\nThis bundle is built to be as lightweight as possible to provide a possibility to alter Twig templates according to the clients device.\n\n## Installation\n\n### Step 1: Composer require\n\n    $ php composer.phar require \"thormeier/mobile-detect-light-bundle\":\"1.0.*\"\n\n### Step2: Enable the bundle in the kernel\n\n    \u003c?php\n    // app/AppKernel.php\n    \n    public function registerBundles()\n    {\n        $bundles = array(\n            // ...\n            new Thormeier\\MobileDetectLightBundle\\ThormeierMobileDetectLightBundle(),\n            // ...\n        );\n    }\n\n## Usage\n\nThere are three new Twig functions provided by this bundle:\n\n### is_mobile()\n\n    // template.html.twig\n\n    {% if is_mobile() %}\n        {# do something that is only visible for mobile users, i.e. display an app store button or similar #}\n    {% endif %}\n\n### is_tablet()\n\n    // template.html.twig\n\n    {% if is_tablet() %}\n        {# do something for tablet users only #}\n    {% endif %}\n\n### is_desktop()\n\n    // template.html.twig\n\n    {% if is_desktop() %}\n        {# do something for desktop users only #}\n    {% endif %}","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthormeier%2Fmobiledetectlightbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthormeier%2Fmobiledetectlightbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthormeier%2Fmobiledetectlightbundle/lists"}