{"id":13536124,"url":"https://github.com/pjkui/kindeditor","last_synced_at":"2026-01-16T05:21:29.311Z","repository":{"id":28150741,"uuid":"31651093","full_name":"pjkui/kindeditor","owner":"pjkui","description":"rich editor for yii2 framework","archived":false,"fork":false,"pushed_at":"2022-02-17T08:06:09.000Z","size":937,"stargazers_count":27,"open_issues_count":0,"forks_count":8,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-26T04:38:07.171Z","etag":null,"topics":["javascript","kindeditor","php","rich-edtor","rich-text-editor","richtexteditor"],"latest_commit_sha":null,"homepage":"http://www.pjkui.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pjkui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-04T10:22:41.000Z","updated_at":"2020-09-10T13:47:14.000Z","dependencies_parsed_at":"2022-09-04T12:11:39.702Z","dependency_job_id":null,"html_url":"https://github.com/pjkui/kindeditor","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pjkui/kindeditor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjkui%2Fkindeditor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjkui%2Fkindeditor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjkui%2Fkindeditor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjkui%2Fkindeditor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pjkui","download_url":"https://codeload.github.com/pjkui/kindeditor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pjkui%2Fkindeditor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477236,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: 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":["javascript","kindeditor","php","rich-edtor","rich-text-editor","richtexteditor"],"created_at":"2024-08-01T09:00:35.021Z","updated_at":"2026-01-16T05:21:29.291Z","avatar_url":"https://github.com/pjkui.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"KindEditor\n===========\n**修复了linux下的一些bug，由于Yii China 无法更新这些信息，抱歉。使用方法务必参考本文，YiiChina上的方法有拼写问题，因为无法修改，所以一定要看这个！！！***\n\n\n中文的使用说明在页面下部\n# install\nEither run\n\n```bash\n$ php composer.phar require pjkui/kindeditor \"*\"\n```\n\nor add\n\n```php\n\"pjkui/kindeditor\": \"*\"\n```\nto the `require` section of your `composer.json` file.\n\n```php\n'pjkui\\\\kindeditor\\\\'=\u003earray($vendorDir . '/pjkui/kindeditor')\n```\n\n# Usage example\n\n## add an actions() method in controller  \n\n```php\npublic function actions()\n{\n    return [\n        'Kupload' =\u003e [\n            'class' =\u003e 'pjkui\\kindeditor\\KindEditorAction',\n        ]\n    ];\n}\n```\n\n## used in view :  \n```php\n\necho \\pjkui\\kindeditor\\KindEditor::widget([]);\n```\n\nor ：\n\n```php\necho $form-\u003efield($model,'colum')-\u003ewidget('pjkui\\kindeditor\\KindEditor',[]);\n```\n\nor ：\n```php\n\u003c?= $form-\u003efield($model, 'content')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n[\n    'clientOptions'=\u003e[\n        'allowFileManager'=\u003e'true',\n        'allowUpload'=\u003e'true'\n        ]\n]) \n?\u003e\n```\n## configure \n you can configure `clientOption` and `editorType` to change the kindeditor's preference, the detail configure see the official website[KindEditor website](http://kindeditor.net/doc.php)\n\n###`editorType` configure\n1. Work as text editor，default configure.\n \nusage:\n```php\n\u003c?= $form-\u003efield($model, 'content')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n        [\n            'clientOptions'=\u003e[\n                'allowFileManager'=\u003e'true',\n                'allowUpload'=\u003e'true'\n                ]\n        ]) \n?\u003e\n```\n \n2. `uploadButton` Kindediotr work as a upload file button ,can upload file/picture to the server automatic \n\nusage:\n```php\n\u003c?= $form-\u003efield($model, 'article_pic')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n                    [\n                        'clientOptions'=\u003e[\n                                        'allowFileManager'=\u003e'true',\n                                        'allowUpload'=\u003e'true'\n                                        ],\n                        'editorType'=\u003e'uploadButton\n                    ]) \n?\u003e\n```\n3. `colorpicker`kindeditor work as color picker \n\nusage:\n```php\n\u003c?= $form-\u003efield($model, 'content')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n                                                    'editorType'=\u003e'colorpicker'])\n        ?\u003e\n```\n4. `file-manager`kindeditor work as file manager,can view and select the file which uploaded by it . \n\nusage:\n```php\n\u003c?= $form-\u003efield($model, 'article_pic')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n                    [\n                        'clientOptions'=\u003e[\n                                'allowFileManager'=\u003e'true',\n                                'allowUpload'=\u003e'true'\n                                    ],\n                        'editorType'=\u003e'file-manager'\n                    ]) \n        ?\u003e\n```\n5. `image-dialog`kindeditor work as image upload dialog. \n\nusage:\n```php\n\u003c?= $form-\u003efield($model, 'article_pic')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n                        [\n                            'clientOptions'=\u003e[\n                                'allowFileManager'=\u003e'true',\n                                'allowUpload'=\u003e'true'\n                                ],\n                            'editorType'=\u003e'image-dialog'\n                        ]) \n?\u003e\n```\n6. `file-dialog`kindeditor work as file upload dialog. \n\nusage:\n```php\n\u003c?= $form-\u003efield($model, 'article_pic')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n                                [\n                                    'clientOptions'=\u003e[\n                                        'allowFileManager'=\u003e'true',\n                                        'allowUpload'=\u003e'true'\n                                        ],\n                                    'editorType'=\u003e'file-dialog'\n                                ])\n    ?\u003e\n```\n\nsimple demo:  \n```php\nuse \\pjkui\\kindeditor\\KindEditor;\necho KindEditor::widget([\n    'clientOptions' =\u003e [\n        //editor size\n        'height' =\u003e '500',\n        //custom menu \n        'items' =\u003e [\n        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',\n        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',\n        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',\n        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',\n        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',\n        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',\n        'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',\n        'anchor', 'link', 'unlink', '|', 'about'\n        ]\n]);\n```\n\nKindEditor中文手册\n===========\n\n# 如何安装\n第一种方法：\n如果装了composer,可以运行这个命令\n\n```php\n$ php composer.phar require pjkui/kindeditor \"*\"\n```\n第二种方法：\n将\n```php\n\"pjkui/kindeditor\": \"*\"\n```\n加入到项目 `composer.json` 文件的`require` 部分。\n\n第三种方法：\n直接将程序文件放到系统的vendor下面,其实建议用compaser,这个是比较方便和规范的安装方法，如果是拷贝的话，有一个文件需要修改，以保证这个kindeditor类被加载。\n这个文件是`/vendor/composer/autoload_psr4.php`.添加一行\n```php\n'pjkui\\\\kindeditor\\\\'=\u003earray($vendorDir . '/pjkui/kindeditor'),\n```\n# 使用方法\n\n##控制器:  \n在控制器中加入这个方法：\n```php\npublic function actions()\n{\n    return [\n        'Kupload' =\u003e [\n            'class' =\u003e 'pjkui\\kindeditor\\KindEditorAction',\n        ]\n    ];\n}\n```\n\n##视图:  \n先在视图中加入\n\n```php\n\necho \\pjkui\\kindeditor\\KindEditor::widget([]);\n```\n\n或者：\n\n```php\necho $form-\u003efield($model,'colum')-\u003ewidget('pjkui\\kindeditor\\KindEditor',[]);\n```\n\n或者：\n```php\n\u003c?= $form-\u003efield($model, 'content')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n['clientOptions'=\u003e['allowFileManager'=\u003e'true',\n'allowUpload'=\u003e'true']]) \n?\u003e\n```\n## 具体相关功能配置\n\n编辑器相关配置，请在`view 中配置，参数为`clientOptions，比如定制菜单，编辑器大小等等，具体参数请查看[KindEditor官网文档](http://kindeditor.net/doc.php)。\n\n### `editorType`配置\n1. 配置为富文本编辑器，默认配置\n \n 示例：\n \n```php\n\u003c?= $form-\u003efield($model, 'content')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n        [\n            'clientOptions'=\u003e[\n                'allowFileManager'=\u003e'true',\n                'allowUpload'=\u003e'true'\n                ]\n        ])\n ?\u003e\n```\n \n2. 这时候配置kindeditor为上传文件按钮，可以自动上传文件到服务器\n 示例：\n \n```php\n\u003c?= $form-\u003efield($model, 'article_pic')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n                    [\n                        'clientOptions'=\u003e[\n                            'allowFileManager'=\u003e'true',\n                            'allowUpload'=\u003e'true'\n                            ],\n                        'editorType'=\u003e'uploadButton\n                    ]) \n?\u003e\n```\n3. 配置kindeditor为取色器\n 示例：\n\n```php\n\u003c?= $form-\u003efield($model, 'content')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n                                                    'editorType'=\u003e'colorpicker')\n        ?\u003e\n```\n4. 配置kindeditor为文件管理器，可以查看和选着其上传的文件。\n 示例：\n\n```php\n\u003c?= $form-\u003efield($model, 'article_pic')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n                    [\n                        'clientOptions'=\u003e[\n                            'allowFileManager'=\u003e'true',\n                            'allowUpload'=\u003e'true'\n                            ],\n                        'editorType'=\u003e'file-manager'\n                        ]) \n        ?\u003e\n```\n5. 配置kindeditor为图片上传对话框。\n 示例：\n\n```php\n\u003c?= $form-\u003efield($model, 'article_pic')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n                        [\n                            'clientOptions'=\u003e[\n                                'allowFileManager'=\u003e'true',\n                                'allowUpload'=\u003e'true'\n                                ],\n                            'editorType'=\u003e'image-dialog'\n                        ]) \n?\u003e\n```\n\n6.  配置kindeditor为文件上传对话框。\n 示例：\n\n```php\n\u003c?= $form-\u003efield($model, 'article_pic')-\u003ewidget('pjkui\\kindeditor\\KindEditor',\n                        [\n                            'clientOptions'=\u003e[\n                                'allowFileManager'=\u003e'true',\n                                'allowUpload'=\u003e'true'\n                                ],\n                            'editorType'=\u003e'file-dialog'\n                        ])\n    ?\u003e\n```\n\n\n简单 示例:  \n```php\nuse \\pjkui\\kindeditor\\KindEditor;\necho KindEditor::widget([\n    'clientOptions' =\u003e [\n        //编辑区域大小\n        'height' =\u003e '500',\n        //定制菜单\n        'items' =\u003e [\n        'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',\n        'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',\n        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',\n        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',\n        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',\n        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image', 'multiimage',\n        'flash', 'media', 'insertfile', 'table', 'hr', 'emoticons', 'baidumap', 'pagebreak',\n        'anchor', 'link', 'unlink', '|', 'about'\n       ],\n       'id'=\u003e'thisID',//填写你想给textarea的id\n]);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjkui%2Fkindeditor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpjkui%2Fkindeditor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpjkui%2Fkindeditor/lists"}