{"id":36978859,"url":"https://github.com/kriptograf/yii2-wishlist","last_synced_at":"2026-01-13T22:48:24.845Z","repository":{"id":57009212,"uuid":"103650300","full_name":"kriptograf/yii2-wishlist","owner":"kriptograf","description":null,"archived":false,"fork":true,"pushed_at":"2017-09-23T18:03:29.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-15T16:40:39.583Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"halumein/yii2-wishlist","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kriptograf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-15T11:37:53.000Z","updated_at":"2017-09-15T11:37:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kriptograf/yii2-wishlist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kriptograf/yii2-wishlist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriptograf%2Fyii2-wishlist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriptograf%2Fyii2-wishlist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriptograf%2Fyii2-wishlist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriptograf%2Fyii2-wishlist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kriptograf","download_url":"https://codeload.github.com/kriptograf/yii2-wishlist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kriptograf%2Fyii2-wishlist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28403734,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-13T22:48:24.111Z","updated_at":"2026-01-13T22:48:24.837Z","avatar_url":"https://github.com/kriptograf.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yii2-wishlist\n==========\nМодуль избранного для Yii2 фреймворка. ДЛЯ любых ПОЛЬЗОВАТЕЛЕЙ\n\n\nУстановка\n---------------------------------\nВыполнить команду\n\n```\ncomposer require kriptograf/yii2-wishlist \"*\"\n```\n\nЛибо в composer.json строку:\n\n```\n\"kriptograf/yii2-wishlist\": \"dev-master\",\n```\n\nДалее, мигрируем базу:\n\n```\nphp yii migrate --migrationPath=vendor/kriptograf/yii2-wishlist/migrations\n```\n\nПодключение и настройка\n---------------------------------\nВ конфигурационный файл приложения добавить модуль и компонент wishlist\n\n```php\n    'modules' =\u003e [\n        'wishlist' =\u003e [\n            'class' =\u003e 'kriptograf\\wishlist\\Module',\n            'dbDateExpired' =\u003e 'CURDATE() + INTERVAL 7 DAY', //дата истечения срока действия избранного в БД\n            'cokieDateExpired' =\u003e time() + 86400 * 365, //Время жизни куки с токеном\n        ],\n        //...\n    ],\n\n    'components' =\u003e [\n        'wishlist' =\u003e [\n            'class' =\u003e 'kriptograf\\wishlist\\Wishlist'\n        ],\n        //...\n    ],\n```\n\nКомпоненты\n===========\nПолучить вишлист ТЕКУЩЕГО пользователя (возвращает массив моделей добавленных в вишлист объектов):\n```php\n\\Yii::$app-\u003ewishlist-\u003egetUserWishList()\n```\n\nПолучить количество добавленных в вишлист объектов для текущего пользователя\n```php\n\\Yii::$app-\u003ewishlist-\u003egetUserWishlistAmount()\n```\n\nВиджеты\n==========\nКнопка добавить/убрать объект в избранное.\n\n```php\n\n\u003c?php\nuse kriptograf\\wishlist\\widgets\\WishlistButton;\n?\u003e\n\n\u003c?php /* Выведет кнопку \"добавить в избранное\" */ ?\u003e\n\u003c?= WishlistButton::widget([\n\t'model' =\u003e $model\n]) ?\u003e\n\n\u003c?php /* Выведет кнопку \"добавить в избранное\" с пользовательскими параметрами */ ?\u003e\n\u003c?= WishlistButton::widget([\n\t'model' =\u003e $model, // модель для добавления\n\t'anchorActive' =\u003e 'В избранном', // свой текст активной кнопки\n\t'anchorUnactive' =\u003e 'В избранное', // свой текст неактивной кнопки\n  'anchorTitleActive' =\u003e 'В избранном',//Свой текст подсказки активной кнопки\n  'anchorTitleUnactive' =\u003e 'В избранное',//свой текст подсказки неактивной кнопки\n\t'htmlTag' =\u003e 'a', // тэг\n\t'cssClass' =\u003e 'custom_class', // свой класс\n    'cssClassInList' =\u003e 'custom_class' // свой класс для добавленного объекта\n]) ?\u003e\n\n```\n\nДефолтные css-стили\n```css\n\n.hal-wishlist-button {\n    font-weight: 700;\n}\n\n.hal-wishlist-button:before {\n    content: \"\\f08a\";\n    font: 400 15px/31px \"FontAwesome\";\n    color: white;\n    background: #929292; /* цвет сердечка */\n    width: 30px;\n    text-align: center;\n    display: inline-block;\n    height: 30px;\n    margin: 0 6px 0 0;\n    -moz-border-radius: 50px;\n    -webkit-border-radius: 50px;\n    border-radius: 50px;\n}\n\n.hal-wishlist-button:hover {\n    cursor: pointer;\n}\n\n.in-list:before {\n    background: #CC63B0; /* цвет сердечка */\n}\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriptograf%2Fyii2-wishlist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkriptograf%2Fyii2-wishlist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkriptograf%2Fyii2-wishlist/lists"}