Contents

Introduction

VEditor is a self-hosted WYSIWYG HTML editor for PHP applications. It has the features people know from TinyMCE and CKEditor 5 (tables, images, media, code blocks, paste from Word, find and replace, source view and more) and comes with a PHP HTML sanitizer that knows the same content model as the editor. It has packages for Laravel and Symfony, a documented integration for Yii2 and plain PHP, and components for React and Vue.

VEditor has zero dependencies: no npm packages, no CDN, no Composer libraries and no build step. The editor is a set of native ES modules loaded by the browser, and the PHP part needs only the dom, libxml and mbstring extensions. Nothing is sent to an external service, except to your AI provider when a user starts an AI function in the AI edition (with your own API key).

How it works

The editor replaces a <textarea> and keeps it in sync, so a normal form post sends the HTML to your server. Every change in the editor goes through commands that work directly on DOM ranges (no document.execCommand), with its own undo history.

The editor's schema decides which tags, attributes, classes and CSS properties the content may contain. VEditor\HtmlSanitizer in PHP implements the same algorithm and the same whitelist:

use VEditor\HtmlSanitizer;

$clean = (new HtmlSanitizer())->sanitize((string) $_POST['content']);

Valid content produced by the editor passes the sanitizer byte for byte. Anything else (a script, an event handler, a javascript: link, an iframe from an unknown domain) is removed, whatever the browser sent.

What is in the package

PartContent
assets/js/the editor: core, UI and plugins as ES modules
assets/veditor.cssthe editor's interface
assets/veditor-content.csscontent styles, also for the public page that shows the content
src/HtmlSanitizer, License, AiApi, AiActions, AiClient, AiException, AiAccountException, Widget, Assets, VEditor (version constants)
autoload.phpautoloader without Composer, loads functions.php
functions.phpveditor_config(), also loaded by the Composer autoloader
config.dist.phpserver configuration template (licence, AI)

Editions

EditionIncludes
Proevery editor feature, the PHP sanitizer and all integrations
AIPro plus the AI assistant, AI chat, text review, autocomplete, alt text and SEO texts, using your own OpenAI or Anthropic API key

Licences are perpetual with 12 months of updates (every X.Y version receives security fixes for 24 months from its release), and cover the purchased domains with their subdomains. Local and test addresses work without a key. See Licence.

Next steps

Something unclear? Send feedback on the documentation.