ThinkPHP3.0 运用百度ueditor的正确配置方法。
ThinkPHP3.0 使用百度ueditor的正确配置方法。。。
使用百度ueditor,按照百度上的文章做配置,编辑器会有控件无法使用的问题,按我的方法完全能全开状态。
文件上传路径自己配置下。。。。。。
第一步:下载ueditor放到 Public 文件夹下。
?
第二步:配置 ueditor?的editor_config.js文件
?
?
URL = window.UEDITOR_HOME_URL||tmp.substr(0,tmp.lastIndexOf("\/")+1).replace("_examples/","").replace("website/","");//这里你可以配置成ueditor目录在您网站的相对路径或者绝对路径(指以http开头的绝对路径) //改为相对路径。。。 URL = window.UEDITOR_HOME_URL||"/Public/ueditor/";
第三步:引用ueditor,在你要使用ueditor的模版文件中写入如下代码:
?
<import type='js' file="ueditor/editor_config" /> <import type='js' file="ueditor/editor_all" /> <import type='css' file="ueditor/themes/default/ueditor" /> ThinkPHP 的默认导入方式,直接就是Public目录下,不要写后缀
第四步:设置Model.class.php文件存入规则:
?
?
array('text','htmldecode', 3,'callback'), //ThinkPHP3 正文(text)字段的自动完成规则 //文本转义 function htmldecode(){ if(!empty($_POST['text'])){ $contents=htmlspecialchars(stripslashes($_POST['text'])); return $contents; } }
第五步:HTML页面应用与提取数据
?
?
<textarea type="text" name="text" id="text" style="width:100%;"/>{$list.text|htmlspecialchars_decode}</textarea> <!--转义在这里视乎没有什么用,还是写上吧!--> <!--script写到body外面--> <script type="text/javascript"> var editor = new baidu.editor.ui.Editor(); editor.render("text");//这里认的是上面控件的ID </script>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

To run the ThinkPHP project, you need to: install Composer; use Composer to create the project; enter the project directory and execute php bin/console serve; visit http://localhost:8000 to view the welcome page.

ThinkPHP has multiple versions designed for different PHP versions. Major versions include 3.2, 5.0, 5.1, and 6.0, while minor versions are used to fix bugs and provide new features. The latest stable version is ThinkPHP 6.0.16. When choosing a version, consider the PHP version, feature requirements, and community support. It is recommended to use the latest stable version for best performance and support.

Steps to run ThinkPHP Framework locally: Download and unzip ThinkPHP Framework to a local directory. Create a virtual host (optional) pointing to the ThinkPHP root directory. Configure database connection parameters. Start the web server. Initialize the ThinkPHP application. Access the ThinkPHP application URL and run it.

Performance comparison of Laravel and ThinkPHP frameworks: ThinkPHP generally performs better than Laravel, focusing on optimization and caching. Laravel performs well, but for complex applications, ThinkPHP may be a better fit.

ThinkPHP installation steps: Prepare PHP, Composer, and MySQL environments. Create projects using Composer. Install the ThinkPHP framework and dependencies. Configure database connection. Generate application code. Launch the application and visit http://localhost:8000.

The usage of the Type keyword in Go includes defining new type aliases or creating new structure types. Detailed introduction: 1. Type alias. Use the "type" keyword to create an alias for an existing type. This alias does not create a new type, but only provides a new name for the existing type. Type aliases can improve code. The readability of the code makes the code clearer; 2. Structure type. Use the "type" keyword to create a new structure type. The structure is a composite type that can be used to define custom types containing multiple fields. etc.

"Development Suggestions: How to Use the ThinkPHP Framework to Implement Asynchronous Tasks" With the rapid development of Internet technology, Web applications have increasingly higher requirements for handling a large number of concurrent requests and complex business logic. In order to improve system performance and user experience, developers often consider using asynchronous tasks to perform some time-consuming operations, such as sending emails, processing file uploads, generating reports, etc. In the field of PHP, the ThinkPHP framework, as a popular development framework, provides some convenient ways to implement asynchronous tasks.

An error occurs when ubuntu mounts a mobile hard disk: mount: unknownfilesystemtype'exfat'. The processing method is as follows: Ubuntu13.10 or install exfat-fuse: sudoapt-getinstallexfat-fuseUbuntu13.04 or below sudoapt-add-repositoryppa:relan/exfatsudoapt-getupdatesudoapt-getinstallfuse- exfatCentOS Linux mount exfat format USB disk error solution to load extfa in CentOS
