Home >php教程 >php手册 >PHP editor函数调用可视化编辑器

PHP editor函数调用可视化编辑器

WBOY
WBOYOriginal
2016-06-13 11:12:101197browse

我们在这里将会为大家介绍一种功能强大的函数,专门用来进行可视化编辑器的调用。这一函数就是

PHP editor函数语法

editor($textareaid = 'content', $toolbar = 'phpcms', $width = 500, $height = 400)

$textareaid 为文本框 id

$toolbar 为工具按钮样式,目前有 phpcms 和 introduce 两种可以选择,一般较大的内容编辑框用 phpcms,而简要介绍则用 introduce

$width 指定编辑器的宽度

$height 指定编辑器的高度

例如:在文章模块发布文章时的内容编辑采用可视化编辑器的PHP editor函数代码如下

<ol class="dp-xml">
<li class="alt"><span><span class="tag"><span> </span><span class="tag-name">textarea</span><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>
</li>
<li><span class="tag"><span> /textarea</span><span class="tag">></span><span> </span></span></li>
<li class="alt"><span class="tag"><span> ?=editor("content",<br>"phpcms",550,400)  </span></span></li>
<li>
<span class="tag">?></span><span> </span>
</li>
</ol>

以上就是PHP editor函数的相关使用方法介绍。


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn