Application of FCK problem in thinkphp
FCK
Vendor ("Fckeditor.fckeditor");
$editor = new FCKeditor ();
$editor->width = ' 100% ';
$editor->height = ' 400 ';
$this->value = $_post[' content '];
$editor->instancename = ' content ';
$fckHtml = $editor->createhtml ();
$this->assign (' fckhtml ', $fckHtml);
The above code in the Add method uses no errors, and in the Edit method use hint: illegal operation thinkphp, what problem? Please expert advice!
------Solution--------------------
No indication of illegal operation?
PHP code
public function index () {...//other code vendor (" Fckeditor.fckeditor ");//contains the FCKeditor class library, TP introduces the third-party class library system method, its path is relative to the vendor directory. $editor = new FCKeditor (); Instantiate the FCKeditor object $editor->width= ' 980′;//set the width that the editor actually needs. If this item is omitted, the default width is used. $editor->height= ' 400′;//sets the height that the editor actually needs. If this item is omitted, the default height is used. $this->value= ";//Set the editor initial value. It can also be a set value when modifying data. can be placed empty. $editor->instancename= ' comment ';//the ID and name of the input tag in the form where the editor is located, the ID of the tag and name. Leave here//set to comment. It is not to be saved here, but also to remain unique. Once the form is uploaded to the server handler, it can be read by $_post[' comment '. $html = $editor->createhtml ();//Create an online editor HTML code string and assign a value to the string variable $html. $this->assign (' HTML ', $html);//Will $ The value of the HTML is assigned to the template variable $html. The template can be referenced directly by {$html}. ...//other code, including output templates. }