Home > Article > Backend Development > PHP editor function calls visual editor_PHP tutorial
Here we will introduce to you a powerful function specially used to call the visual editor. This function is
PHP editor function syntax
editor($textareaid = 'content', $toolbar = 'phpcms', $width = 500, $height = 400)
$textareaid is the text box id
$toolbar is the tool button style. There are currently two options: phpcms and introduce. Generally, phpcms is used for larger content editing boxes, and a brief introduction Then use introduce
$width to specify the width of the editor
$height to specify the height of the editor
For example: when publishing articles in the article module, a visual editor is used for content editing. The PHP editor function code is as follows
<ol class="dp-xml"> <li class="alt"><span><span class="tag"><</span><span> </span><span class="tag-name">textarea</span><span> </span></span></li><li><span class="attribute">name</span><span>=</span><span class="attribute-value">"article[content]"</span><span> </span></li><li class="alt"><span class="attribute">id</span><span>=</span><span class="attribute-value">"content"</span><span> </span><span class="attribute">cols</span><span>=</span><span class="attribute-value">"60"</span><span> <br /></span><span class="attribute">rows</span><span>=</span><span class="attribute-value">"4"</span><span class="tag">></span><span> </span></span></li> <li> <span class="tag"><</span><span> /textarea</span><span class="tag">></span><span> </span> </li> <li class="alt"> <span class="tag"><</span><span> ?=editor("content",<br />"phpcms",550,400) </span></li><li><span class="tag">?></span><span> </span> </li> </ol>
The above is an introduction to the relevant usage of the PHP editor function.