jeffkee
jeffkee

Reputation: 5238

Creating a web-based code editor

I'm looking into creating a web-based code editor pane on my CMS. I would want something very similar to what Wordpress has if you go under the templates and edit individual .css or .php files. Are there easy plugins for this?

Security is not a HUGE issue, as this is a closed system, and the people using my CMS to manipulate the .php code etc. would only hurt themselves if they broke anything or injected code there.

So I want to get an idea of how I can accomplish this - write my own? Plug-ins that display file contents in an easy format?

Upvotes: 0

Views: 2225

Answers (1)

Tim M.
Tim M.

Reputation: 54377

Code Mirror will get you the basic features/behavior of an IDE in a variety of languages. I use it for a simple query editor in one of my applications. They have a PHP plugin available and you can write/modify your own.

Keep in mind that you should sanitize any input that is coming from an untrusted source. Even if your system is "closed loop" you may want to run user-provided code in a sandbox or have it undergo some sort of approval workflow.

There is also Compilr, but I don't know how well that integrates into a custom application.

Upvotes: 2

Related Questions