{"id":28635419,"url":"https://github.com/dmstr/yii2-cookie-button","last_synced_at":"2025-06-12T17:10:14.674Z","repository":{"id":19938193,"uuid":"23204803","full_name":"dmstr/yii2-cookie-button","owner":"dmstr","description":"Widget to store 0/1 in a cookie for Yii2 Framework","archived":false,"fork":false,"pushed_at":"2023-11-16T11:10:50.000Z","size":343,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-05-11T04:02:51.563Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmstr.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2014-08-21T22:16:42.000Z","updated_at":"2022-01-20T12:53:46.000Z","dependencies_parsed_at":"2024-06-19T17:38:13.962Z","dependency_job_id":"88207827-414f-4f67-a275-1c9895fad0db","html_url":"https://github.com/dmstr/yii2-cookie-button","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/dmstr/yii2-cookie-button","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmstr%2Fyii2-cookie-button","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmstr%2Fyii2-cookie-button/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmstr%2Fyii2-cookie-button/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmstr%2Fyii2-cookie-button/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmstr","download_url":"https://codeload.github.com/dmstr/yii2-cookie-button/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmstr%2Fyii2-cookie-button/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259509474,"owners_count":22868837,"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":[],"created_at":"2025-06-12T17:10:13.944Z","updated_at":"2025-06-12T17:10:14.650Z","avatar_url":"https://github.com/dmstr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yii 2 Cookie Button\n==================\n\nYii 2 Cookie Button based on \"Twitter Bootstrap\" Button or ButtonGroup.\nWidget to store 0/1 in a cookie for Yii2 Framework.  \nAdd and remove cookies via javascript, with help of [carhartl / jquery-cookie plugin](https://github.com/carhartl/jquery-cookie).\n\nUsage\n-----\n\n### Single button (default)\n\n        $button = CookieButton::widget([\n            'label' =\u003e FA::icon(FA::_EYE),\n            'encodeLabel' =\u003e false,\n            'toggleClass' =\u003e 'btn-primary',\n            'cookieName' =\u003e 'Key-or-Name',\n            'cookieValue' =\u003e 'on',\n            'cookieOptions' =\u003e [\n                'path' =\u003e '/',\n                'http' =\u003e true,\n                'expires' =\u003e strtotime('1 week')\n            ],\n            'options' =\u003e [\n                'class' =\u003e 'btn-primary',\n            ]\n        ]);\n\n### Switch button\n\n    echo CookieButton::widget([\n        'label' =\u003e ['On', 'Off'],           // String for default button, array for switch button\n        'toggleClass' =\u003e 'btn-primary',     // Only needed if button type is switch\n        'cookieName' =\u003e 'Key-or-Name',\n        'cookieValue' =\u003e 'on',\n        'options' =\u003e [\n            'id' =\u003e 'cookieSwitchBtn',      // The button id\n            'class' =\u003e 'btn-xs'             // Default button class\n        ],\n        'cookieOptions' =\u003e [\n            'options' =\u003e [                  // 'options' are optional\n                'expires' =\u003e 365,           // Define lifetime of the cookie.\n                                            // Value can be a Number which will be interpreted as days\n                                            // from time of creation or a Date object.\n                                            // If omitted, the cookie becomes a session cookie.\n                'path' =\u003e '/',              // Define the path where the cookie is valid.\n                                            // By default the path of the cookie is the path of the page\n                                            //where the cookie was created\n                                            //(standard browser behavior).\n                'domain' =\u003e 'example.com',  // Define the domain where the cookie is valid.\n                                            // Default: domain of page where the cookie was created.\n                'secure' =\u003e true            // If true, the cookie transmission requires a secure protocol (https).\n                                            // Default: false.\n            ]\n        ]\n    ]);\n\n\nInstallation\n------------\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nAdd repository url to the required section of your `composer.json` file.\n\n    \"repositories\": [\n        {\n            \"type\": \"git\",\n            \"url\": \"https://github.com/dmstr/yii2-cookie-button.git\"\n        }\n    ],\n\nEither run\n\n    php composer.phar require dmstr/yii2-cookie-button \"*\"\n\nor add\n\n    \"dmstr/yii2-cookie-button\": \"*\"\n\n\nto the required section of your `composer.json` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmstr%2Fyii2-cookie-button","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmstr%2Fyii2-cookie-button","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmstr%2Fyii2-cookie-button/lists"}