{"id":28635422,"url":"https://github.com/dmstr/yii2-widgets2-module","last_synced_at":"2025-10-29T12:06:11.737Z","repository":{"id":17602329,"uuid":"82327432","full_name":"dmstr/yii2-widgets2-module","owner":"dmstr","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-21T10:59:35.000Z","size":627,"stargazers_count":9,"open_issues_count":6,"forks_count":8,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-26T18:55:11.477Z","etag":null,"topics":["content","template","twig","widgets","yii2"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"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-02-17T18:44:36.000Z","updated_at":"2025-03-21T10:59:14.000Z","dependencies_parsed_at":"2024-02-27T17:31:29.020Z","dependency_job_id":"1eb39930-d195-47f9-beaa-6ec03d16d025","html_url":"https://github.com/dmstr/yii2-widgets2-module","commit_stats":{"total_commits":349,"total_committers":12,"mean_commits":"29.083333333333332","dds":0.5501432664756447,"last_synced_commit":"08cd2d3f94a44c76d5824b7a9b5bd850f35cbb60"},"previous_names":[],"tags_count":124,"template":false,"template_full_name":null,"purl":"pkg:github/dmstr/yii2-widgets2-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmstr%2Fyii2-widgets2-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmstr%2Fyii2-widgets2-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmstr%2Fyii2-widgets2-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmstr%2Fyii2-widgets2-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmstr","download_url":"https://codeload.github.com/dmstr/yii2-widgets2-module/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmstr%2Fyii2-widgets2-module/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":["content","template","twig","widgets","yii2"],"created_at":"2025-06-12T17:10:14.167Z","updated_at":"2025-10-29T12:06:06.697Z","avatar_url":"https://github.com/dmstr.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Yii2 Widget Module\n===============\n\n[![Latest Stable Version](https://poser.pugx.org/dmstr/yii2-widgets2-module/v/stable.svg)](https://packagist.org/packages/dmstr/yii2-widgets2-module) \n[![Total Downloads](https://poser.pugx.org/dmstr/yii2-widgets2-module/downloads.svg)](https://packagist.org/packages/dmstr/yii2-widgets2-module)\n[![License](https://poser.pugx.org/dmstr/yii2-widgets2-module/license.svg)](https://packagist.org/packages/dmstr/yii2-widgets2-module)\n\nWidget manager using twig templates\n\nInstallation\n---\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```\ncomposer require dmstr/yii2-widgets2-module\n```\n\nto the require section of your `composer.json` file.\n\n\nTesting\n---\n\n```\ncd tests\n\ndocker-compose up -d\n\ndocker-compose run phpfpm bash\n\nsetup.sh\n```\n\nConfig\n---\n\n```\n...\n'modules =\u003e [\n\t'widgets' =\u003e [\n\t\t'class' =\u003e '\\hrzg\\widget\\Module',\n\t\t'layout' =\u003e '@backend/views/layouts/main',\n\t\t'playgroundLayout' =\u003e '@frontend/views/layouts/main',\n\t\t'dateBasedAccessControl' =\u003e true,\n\t\t'datepickerMinutes' =\u003e false,\n\t\t'timezone' =\u003e 'Europe/Berlin',\n\t\t// set ajax option for JsonEditor\n\t\t'allowAjaxInSchema' =\u003e false,\n        // If true, the json content properties will be validated against the json schema from the widget_template.\n        // To be BC the default is false, but you should enable it\n\t\t'validateContentSchema' =\u003e false\n\t]\n]\n...\n```\n\n\n\n\nSettings\n---\n\n`availablePhpClasses`\n`availableFrontendPhpClasses` - Templates with one of the listed classes in this setting will be outputed in cell widgets dropdown for available templates (default: hrzg\\widget\\widgets\\TwigTemplate)\n\n\nUsage\n---\n\nOnce the extension is installed, simply use it in your code by :\n\n### Layout\n\nExample with `yii2-prototype-module`\n\n- [Yii 2.0 Twig extension](https://github.com/yiisoft/yii2-twig/tree/master/docs/guide)\n- [Twig documentation](http://twig.sensiolabs.org/documentation)\n\n```\n{{ use ('hrzg/widget/widgets') }}\n{{ cell_widget({id: 'main'}) }}\n```\n\n### Widget\n\n- Standard Twig widget `hrzg\\widget\\widgets\\TwigTemplate`\n- Char-Rank ordering `001`, `10`, `5`, `aa1`, `aa1.2`, `b0` (not numeric) \n\n### JSON\n\n- [JSON schema editor](https://github.com/jdorn/json-editor)\n\n### Settings\n\n**Section:** widgets\n\n**Key:** availablePhpClasses\n\n**Type:** JSON\n\n####Example:\n \n`{\"hrzg\\\\widget\\\\widgets\\\\TwigTemplate\": \"Twig layout\"}`\n\n### Widget example\n\n#### Basic\n\n```\n{\n    \"title\": \"Basic\",\n    \"type\": \"object\",\n    \"properties\": {\n        \"headline\": {\n            \"type\": \"string\",\n            \"default\": \"Avo vole tioma profitanto ts,\"\n        },\n        \"text_html\": {\n            \"type\": \"string\",\n            \"format\": \"html\",\n            \"default\": \"Ja sub kiam aliu, fo unt fora danke helpverbo, dev bv tele kibi piedpilko.\",\n            \"options\": {\n                \"wysiwyg\": true\n            }\n        }\n    }\n}\n```\n\n```\n\u003ch2\u003e{{ headline }}\u003c/h2\u003e\n\u003cp\u003e{{ text_html }}\u003c/p\u003e\n```\n\n\nFor more examples, please see the [docs](./docs)\n\n\nUpgrading\n---------\n\n### from 0.2 to 0.3\n\n    {{ cell_widget({id: 'header'}) }}\n\nRBAC\n---\n\n#### Available Permission items\n\nName | Description\n--- | ---\nwidgets_default_index | Widgets Manager\nwidgets_crud_api | Widgets CRUD API\nwidgets_crud_widget | Widgets CRUD Content\nwidgets_crud_widget_create | Widgets CRUD Content Create\nwidgets_crud_widget_delete | Widgets CRUD Content Delete\nwidgets_crud_widget_index | Widgets CRUD Content Index\nwidgets_crud_widget_update | Widgets CRUD Content Update\nwidgets_crud_widget_view | Widgets CRUD Content View\nwidgets_crud_widget-template | Widgets CRUD Template\nwidgets_test | Widgets TEST Playground\nwidgets-cell-edit | Frontend editing\nwidgets | Widgets Module\n\n\nSettings\n---\n\n\u003ctable\u003e\n    \u003cthead\u003e\n        \u003ctr\u003e\n            \u003cth\u003eSection\u003c/th\u003e\n            \u003cth\u003eKey\u003c/th\u003e\n            \u003cth\u003eValue\u003c/th\u003e\n            \u003cth\u003eType\u003c/th\u003e\n        \u003c/tr\u003e\n    \u003c/thead\u003e\n    \u003ctbody\u003e\n        \u003ctr\u003e\n            \u003ctd\u003ewidgets\u003c/td\u003e\n            \u003ctd\u003eckeditor.config\u003c/td\u003e\n            \u003ctd\u003e\n\u003cpre\u003e\n    {\n      \"height\": \"4000px\",\n      \"toolbar\": [\n        [\"Format\"],\n        [\"Link\", \"Image\", \"Table\", \"-\", \"NumberedList\", \"BulletedList\", \"-\", \"JustifyLeft\", \"JustifyCenter\", \"JustifyRight\", \"JustifyBlock\"],\n        [\"Source\"],\n        \"/\", [\"Bold\", \"Italic\", \"Underline\", \"StrikeThrough\", \"-\", \"RemoveFormat\", \"-\", \"Undo\", \"Redo\", \"-\", \"Paste\", \"PasteText\", \"PasteFromWord\", \"-\", \"Cut\", \"Copy\", \"Find\", \"Replace\", \"-\", \"Outdent\", \"Indent\", \"-\", \"Print\"]\n      ]\n    }\n\u003c/pre\u003e\n            \u003c/td\u003e\n            \u003ctd\u003eOBJECT/JSON\u003c/td\u003e\n        \u003c/tr\u003e\n    \u003c/tbody\u003e\n\u003c/table\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmstr%2Fyii2-widgets2-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmstr%2Fyii2-widgets2-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmstr%2Fyii2-widgets2-module/lists"}