简体   繁体   中英

RichTextEditor that is PHP/code friendly to snippets of php

I can't seem to find a js RTE that will play friendly with snippets of php intertwined in it. I want a mini CMS for the backend of a number of sites. The views have some snippets of php here and there

Are there any RTE's that will leave the php alone, and even show it mixed with the nice formatting?

TinyMCE kills the tags even when entered in html mode and switched back and forth. FCKEdit seems to keep the code intact if pasted into source mode, but it isn't shown in the editing side, so if someone deletes an element with some php in it, bop, it's gone.

And none of the editors like creating nicely indented code, that would be a nice plus as well, but probably over the top to ask, heh.

The Javascript rich text editors make use of the browsers' in-built DesignMode or ContentEditable features in order to implement in-line HTML editing, and these do not support embedded PHP tags.

The solution would have to convert these to some other form, which is not going to get mushed by the browser's HTML editor, then convert them back to PHP tags upon submission.

It could be done. I don't know of any that do, however.

As for creating nicely indented code, it is a similar issue. The browsers munge it in their in-line HTML editors.

I had a similar question a few weeks back: Textarea that can do syntax highlighting on the fly?

This may be the right thing for you: http://marijn.haverbeke.nl/codemirror/ They even have mixed PHP and HTML highlighting.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM