{"id":13770728,"url":"https://github.com/zakurdaev/yii2-editorjs-widget","last_synced_at":"2026-01-16T00:37:40.665Z","repository":{"id":57089196,"uuid":"263117327","full_name":"zakurdaev/yii2-editorjs-widget","owner":"zakurdaev","description":"Editor.js widget for Yii 2","archived":false,"fork":false,"pushed_at":"2020-05-12T17:04:46.000Z","size":162,"stargazers_count":10,"open_issues_count":2,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-21T00:54:41.120Z","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/zakurdaev.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}},"created_at":"2020-05-11T17:55:41.000Z","updated_at":"2024-12-23T11:52:46.000Z","dependencies_parsed_at":"2022-08-20T16:00:33.992Z","dependency_job_id":null,"html_url":"https://github.com/zakurdaev/yii2-editorjs-widget","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/zakurdaev%2Fyii2-editorjs-widget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakurdaev%2Fyii2-editorjs-widget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakurdaev%2Fyii2-editorjs-widget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zakurdaev%2Fyii2-editorjs-widget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zakurdaev","download_url":"https://codeload.github.com/zakurdaev/yii2-editorjs-widget/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253514352,"owners_count":21920327,"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":"2024-08-03T17:00:41.169Z","updated_at":"2026-01-16T00:37:40.617Z","avatar_url":"https://github.com/zakurdaev.png","language":"PHP","funding_links":[],"categories":["Libraries"],"sub_categories":["PHP"],"readme":"# Editor.js Widget for Yii 2\n\n`Editor.js Widget` is a wrapper for [Editor.js](https://github.com/codex-team/editor.js), next generation block styled editor.\n\n## Install\n\nThe preferred way to install this extension is through [composer](http://getcomposer.org/download/).\n\nEither run\n\n```bash\n$ php composer.phar require --prefer-dist zakurdaev/yii2-editorjs-widget \"*\"\n```\n\nor add\n\n```json\n\"zakurdaev/yii2-editorjs-widget\": \"*\"\n```\n\nto the `require` section of your `composer.json` file.\n\n\n## Usage\n\nOnce the extension is installed, simply use it in your code:\n\n### Like a widget\n\n```php\necho \\zakurdaev\\editorjs\\EditorJsWidget::widget([\n    'selector' =\u003e 'redactor'\n]);\n```\n\n### Like an ActiveForm widget\n\n```php\nuse \\zakurdaev\\editorjs\\EditorJsWidget;\n\necho $form-\u003efield($model, 'content_json')-\u003ewidget(EditorJsWidget::class, [\n 'selectorForm' =\u003e $form-\u003eid\n])-\u003elabel();\n```\n### Supported block\nThe plugin is able to support all blocks for Editor.js. You can use the standard Asset or use Asset CDN or write your own.\n\n#### EditorJsAsset\nInclude: \n* editorjs/header v2.4.1\n* editorjs/paragraph v2.6.1\n* editorjs/image v2.3.4\n* editorjs/list v1.4.0\n* editorjs/table v1.2.2\n* editorjs/quote v2.3.0\n* editorjs/warning v1.1.1\n* editorjs/code v2.4.1\n* editorjs/embed v2.3.1\n* editorjs/delimiter v1.1.0\n* editorjs/inline-code v1.3.1\n\n#### Custom Asset\n```php\nuse \\zakurdaev\\editorjs\\EditorJsWidget;\n\necho $form-\u003efield($model, 'content_json')-\u003ewidget(EditorJsWidget::class, [\n 'selectorForm' =\u003e $form-\u003eid,\n 'assetClass' =\u003e 'YOUR/PATH/TO/ASSET'\n])-\u003elabel();\n```\n\n\n### Upload image by file and url\n\nWidget supports image loading for [Editor.js Image Block](https://github.com/editor-js/image).\n\n```php\n// SiteController.php\npublic function actions()\n{\n    return [\n        'upload-file' =\u003e [\n            'class' =\u003e UploadImageAction::class,\n            'mode' =\u003e UploadImageAction::MODE_FILE,\n            'url' =\u003e 'https://example.com/upload_dir/',\n            'path' =\u003e '@app/web/upload_dir',\n            'validatorOptions' =\u003e [\n                'maxWidth' =\u003e 1000,\n                'maxHeight' =\u003e 1000\n            ]\n        ],\n        'fetch-url' =\u003e [\n            'class' =\u003e UploadImageAction::class,\n            'mode' =\u003e UploadImageAction::MODE_URL,\n            'url' =\u003e 'https://example.com/upload_dir/',\n            'path' =\u003e '@app/web/upload_dir'\n        ]\n    ];\n}\n\n// view.php\necho \\zakurdaev\\editorjs\\EditorJsWidget::widget([\n    'selector' =\u003e 'redactor',\n    'endpoints' =\u003e [\n        'uploadImageByFile' =\u003e Url::to(['/site/upload-file']),\n        'uploadImageByUrl' =\u003e Url::to(['/site/fetch-url']),\n    ],\n]);\n```\n\n## License\nThe BSD License (BSD).Please see [License File](LICENSE.md) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakurdaev%2Fyii2-editorjs-widget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzakurdaev%2Fyii2-editorjs-widget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzakurdaev%2Fyii2-editorjs-widget/lists"}