简体   繁体   English

CKEditor:编辑模板(例如PHP,JSP,ASP等…,即非标准HTML)

[英]CKEditor: Editing templates (e.g. PHP, JSP, ASP, … i.e. non-standard HTML)

Hi all once again ! 再次大家好! I'm developing this plugin to edit PHP pages using CKEditor (please watch demo videos for further details ;o) . 我正在开发此插件以使用CKEditor 编辑PHP页面 (请观看演示视频以获取更多详细信息; o) Everything works fine if I try to insert PHP code inside <pre> tag so as to render the code inside that page. 如果我尝试在<pre>标记内插入PHP代码,以便在该页面内呈现代码,则一切正常。

The fact is that I need to insert PHP code directly inside the code of target web page (well it's a PHP page indeed ...) because the idea is to insert PHP snippets that will be evaluated and expanded later in server-side. 事实是,我需要将PHP代码直接插入目标网页的代码中(实际上,这确实是一个PHP页面...),因为这样的想法是插入PHP代码段,这些代码段稍后将在服务器端进行评估和扩展。

In this demo video you can see that once I insert PHP code directly inside <div> tag (ie in source mode) and switch back to source mode again then the whole PHP block is sanitized thus replaced by &nbsp; 此演示视频中,您可以看到,一旦我将PHP代码直接插入<div>标记内(即在源模式下)并再次切换回源模式,则整个PHP块都将被清理,因此由&nbsp;替换&nbsp; entity. 实体。 The same happens if the plugin tries to insert the same snippet (ie in WYSIWYG mode) once Ok button is pressed. 如果插件在按下“ 确定”按钮后尝试插入相同的代码段(即在“ 所见即所得”模式下),则会发生相同的情况。

So questions are : 所以问题是:

  1. Is it possible to do something so as to instruct CKEditor to not obfuscate PHP block ? 是否有可能做一些事情来指示CKEditor不要混淆PHP块?
  2. Does anybody has a hint or a way to work around this behavior ? 是否有人暗示或解决此问题的方法?

Thanks in advance ! 提前致谢 !

使用config.protectedSource设置,该页面甚至列出了如何在PHP中使用它

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 非标准注释中的“Classlike未定义或导入任何地方。”(例如@prepare,@ access) - “Classlike is not defined or imported anywhere.” on non-standard annotations (e.g. @prepare, @access) 如何在PHP中循环$ num,例如1、2、3、4、1、2、3、4、1、2、3、4 - How to loop $num in php, e.g. 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4, PHP中的“ @”符号,例如“ @ $ name [1]”吗? - '@' symbol in php, e.g. '@$name[1]'? 如果可以,HTML可以嵌入普通的(即非替代性)PHP中吗? - Can HTML be embedded inside normal (i.e. not alternative) PHP if? 如何提取某些HTML标签,例如 <ul> 在PHP中使用带有preg_match_all的Regex? - How can I extract certain HTML tags e.g. <ul> using Regex with preg_match_all in PHP? 将html解码(例如&gt;和&lt;)转换为普通可读文本(例如&gt;和&lt;) - Convert html decode (e.g. &gt; and &lt;) to a normal readable text( e.g. > and <) PHP函数使用preg_replace替换HTML标记(例如,元描述) - PHP function to replace a HTML tag (e.g. meta description) using preg_replace 回显 php 标识符,因为它们是语法上的! - Echo php identifiers as they are i.e. syntactically! 如何在PHP中使用Ajax从网站(例如IMDB)中获取数据 - How can I fetch data from a website (e.g. IMDB ) using Ajax in PHP 在 PHP 中,我可以为 class 属性设置别名吗? 例如通过 Trait 允许 ArrayAccess 方法 - In PHP, can I alias a class property? E.g. to allow ArrayAccess methods via Trait
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM