{"id":20523099,"url":"https://github.com/itstructure/yii2-field-widgets","last_synced_at":"2025-04-14T03:04:35.558Z","repository":{"id":56994566,"uuid":"120178485","full_name":"itstructure/yii2-field-widgets","owner":"itstructure","description":"The form field widgets for Yii2 Framework with multilanguage mode support","archived":false,"fork":false,"pushed_at":"2023-01-29T04:19:25.000Z","size":19,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-09T02:24:34.177Z","etag":null,"topics":["field","multilanguage","widget","yii2"],"latest_commit_sha":null,"homepage":"","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/itstructure.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.md","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":"2018-02-04T11:22:08.000Z","updated_at":"2023-01-31T18:52:51.000Z","dependencies_parsed_at":"2023-02-15T20:35:26.737Z","dependency_job_id":null,"html_url":"https://github.com/itstructure/yii2-field-widgets","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-field-widgets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-field-widgets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-field-widgets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itstructure%2Fyii2-field-widgets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itstructure","download_url":"https://codeload.github.com/itstructure/yii2-field-widgets/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224854926,"owners_count":17380953,"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":["field","multilanguage","widget","yii2"],"created_at":"2024-11-15T22:37:55.797Z","updated_at":"2024-11-15T22:37:56.043Z","avatar_url":"https://github.com/itstructure.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yii2 Field widgets\n==============\n\n## Introduction\n\n[![Latest Stable Version](https://poser.pugx.org/itstructure/yii2-field-widgets/v/stable)](https://packagist.org/packages/itstructure/yii2-field-widgets)\n[![Latest Unstable Version](https://poser.pugx.org/itstructure/yii2-field-widgets/v/unstable)](https://packagist.org/packages/itstructure/yii2-field-widgets)\n[![License](https://poser.pugx.org/itstructure/yii2-field-widgets/license)](https://packagist.org/packages/itstructure/yii2-field-widgets)\n[![Total Downloads](https://poser.pugx.org/itstructure/yii2-field-widgets/downloads)](https://packagist.org/packages/itstructure/yii2-field-widgets)\n[![Build Status](https://scrutinizer-ci.com/g/itstructure/yii2-field-widgets/badges/build.png?b=master)](https://scrutinizer-ci.com/g/itstructure/yii2-field-widgets/build-status/master)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/itstructure/yii2-field-widgets/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/itstructure/yii2-field-widgets/?branch=master)\n\nThis is form field's widgets for the yii2 framework with the next field types:\n\n- text\n- textarea\n- ckeditor\n- ckeditorAdmin\n- file\n- checkbox\n- dropdown\n- password\n\n## Dependencies\n\n- php \u003e= 7.1\n- composer\n\n## Installation\n\n### Base install\n\nVia composer:\n\n`composer require \"itstructure/yii2-field-widgets\": \"~1.2.4\"`\n\nor in section **require** of composer.json file set the following:\n\n```json\n\"require\": {\n    \"itstructure/yii2-field-widgets\": \"~1.2.4\"\n}\n```\n\nand command `composer install`, if you install yii2 project extensions first,\n\nor command `composer update`, if all yii2 project extensions are already installed.\n\n### If you are testing this package from local server directory\n\nIn application `composer.json` file set the repository, like in example:\n\n```json\n\"repositories\": [\n    {\n        \"type\": \"path\",\n        \"url\": \"../yii2-field-widgets\",\n        \"options\": {\n            \"symlink\": true\n        }\n    }\n],\n```\n\nHere,\n\n**yii2-field-widgets** - directory name, which has the same directory level like application and contains yii2 field widgets package.\n\nThen run command:\n\n`composer require itstructure/yii2-field-widgets:dev-master --prefer-source`\n\n## Usage\n\n### Requirements\n\nThat widgets are designed to work in form with an active **model**, which is inherited from \nyii\\db\\ActiveRecord.\n\n### Single mode\n\nTo use this mode, don't set `languageModel`. That will be **null**.\n\n### Multilanguage mode\n\nAll fields will be with a language postfix:\n\n**title_en**\n\n**description_en**\n\n**title_ru**\n\n**description_ru**, e t. c.\n\nFor this mode it's necessary to have Language model with some of languages records.\n\nExample:\n\n```php\n$form = ActiveForm::begin();\n```\n\n```php\necho Fields::widget([\n    'fields' =\u003e [\n        [\n            'name' =\u003e 'title',\n            'type' =\u003e FieldType::FIELD_TYPE_TEXT,\n        ],\n        [\n            'name' =\u003e 'description',\n            'type' =\u003e FieldType::FIELD_TYPE_CKEDITOR_ADMIN,\n            'preset' =\u003e 'full',\n            'options' =\u003e [\n                'filebrowserBrowseUrl' =\u003e '/ckfinder/ckfinder.html',\n                'filebrowserImageBrowseUrl' =\u003e '/ckfinder/ckfinder.html?type=Images',\n                'filebrowserUploadUrl' =\u003e '/ckfinder/core/connector/php/connector.php?command=QuickUpload\u0026type=Files',\n                'filebrowserImageUploadUrl' =\u003e '/ckfinder/core/connector/php/connector.php?command=QuickUpload\u0026type=Images',\n                'filebrowserWindowWidth' =\u003e '1000',\n                'filebrowserWindowHeight' =\u003e '700',\n            ]\n        ],\n    ],\n    'model'         =\u003e $model,\n    'form'          =\u003e $form,\n    'languageModel' =\u003e new Language()\n]) ?\u003e\n```\n\n```php\necho Html::submitButton($model-\u003eisNewRecord ? 'Create' : 'Update', ['class' =\u003e $model-\u003eisNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?\u003e\n```\n\n```php\nActiveForm::end();\n```\n\n## License\n\nCopyright © 2018-2023 Andrey Girnik girnikandrey@gmail.com.\n\nLicensed under the [MIT license](http://opensource.org/licenses/MIT). See LICENSE.txt for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitstructure%2Fyii2-field-widgets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitstructure%2Fyii2-field-widgets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitstructure%2Fyii2-field-widgets/lists"}