Install the method to configure the fckeditor editor in PHP
- 2020-03-31 21:35:34
- OfStack
PHP calls fckeditor.
JS calls fckeditor.
FCKeditor js calls method one
FCKeditor js calls method two
JS calls fckeditor.
<?php
require_once(PATH_PRE. " fckeditor.php " ); //Contains the fckeditor class,
$oFCKeditor = new FCKeditor('content') ; //Create an fckeditor object with the form name content
$oFCKeditor->BasePath= " ../fckeditor/ " ; //The directory where the editor resides
$oFCKeditor->ToolbarSet= " Yiyunnet " ; //The Default editor toolbar has Basic (Basic) Default (all tools) Soft(one column can insert pictures and videos) Renpeng (two columns can upload pictures and videos) Full (three columns)
$oFCKeditor->Height='100%'; //highly
$oFCKeditor->Width='100%'; //The width of the
$oFCKeditor->Value= " "; //The initial value can also be set to the following part (" = "contains part), not required:
$oFCKeditor->Config['SkinPath'] = ' ../editor/skins/silver/'; //There are three skins for setting editor skins default
$oFCKeditor->Create(); //Just output the value of the variable $myeditor where you want to display the editor
?>
FCKeditor js calls method one
<script src= " fckeditor/fckeditor.js " ></script>
<script type= " text/javascript " >
var oFCKeditor = new FCKeditor( ' Content' ) ;
oFCKeditor.BasePath = ' fckeditor/' ;
oFCKeditor.ToolbarSet = ' Basic' ;
oFCKeditor.Width = ' 100%' ;
oFCKeditor.Height = ' 400 ' ;
oFCKeditor.Value = " ;
oFCKeditor.Create() ;
</script>
FCKeditor js calls method two
<script src= " fckeditor/fckeditor.js " ></script>
<script type= " text/javascript " >
function showFCK(){
var oFCKeditor = new FCKeditor('Content') ;
oFCKeditor.BasePath = ' fckeditor/' ;
oFCKeditor.ToolbarSet = ' Basic' ;
oFCKeditor.Width = ' 100%' ;
oFCKeditor.Height = ' 200 ' ;
oFCKeditor.Value = " ;
oFCKeditor.ReplaceTextarea() ;
document.getElementByIdx( " btnShow " ).disabled = ' true';
document.getElementByIdx( " btnShow " ).style.display = ' none';
}
</script>
<textarea name= " Content " ></textarea>
<input id=btnShow style= " display:inline " type=button onclick= " showFCK() " >