FCKeditor 2.6 在PHP+Zend Frameword 中的使用
来源:互联网 发布:hdfs java api 端口 编辑:程序博客网 时间:2024/05/17 22:47
具体的看FCKedit 官方文档,这里只记下了在ZF中的使用要点
一、表单生成
1.这里是在控制器中的动作:
2.在 fcke.phtml 中:
<form name="test" action="/test/getfck" method="POST">
<ul>
<li>用户: <input type="text" name="userName" value="" /></li>
<li>密码: <input type="password" name="password" value="" /></li>
<li>
<?php
echo $this->fckeditor->Create();
?>
</li>
</ul>
<ul>
<li><input type="submit" value="提交" /><input type="reset" value="取消" /></li>
</ul>
</form>
二、获得表单值:
1.控制器中的动作
2. getfck.phtml
三、关键事项:
1.
在 fckeditor 目录、你要放上传文件的 userfiles 目录,以及其它不用解析的public 目录(我的这三个目录同入口文件 index.php 一起放在html 目录下)里要加上 .htaccess 文件,如下:
2.
图片上传:
功能开启
编辑 fckeditor/editor/filemanager/connectors/php/config.php
四、在FCKeditor 2.6中。发现在上传文件过程中,通过浏览服务器按钮打开的页面来上传,与直接点上传按钮后,这两种情况会有不同的结果---传到服务器不同的目录里,前者要传到 image 目录下,后者却直接传到
userfiles 目录下,可能是个 bug。
一、表单生成
1.这里是在控制器中的动作:
public function fckeAction(){
$oFCKeditor = new FCKeditor('FCKeditor1');
$oFCKeditor->BasePath = '/fckeditor/'; //must add .htaccess file in fckeditor directory, the content of this file only include 'RewriteEngine off'
$oFCKeditor->Width='600';
$oFCKeditor->Height='400';
$oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
$this->view->fckeditor = $oFCKeditor; //->Create() ; //in this controller, not to call FCKeditor->Create(), call it must in view page
$this->render();
}
$oFCKeditor = new FCKeditor('FCKeditor1');
$oFCKeditor->BasePath = '/fckeditor/'; //must add .htaccess file in fckeditor directory, the content of this file only include 'RewriteEngine off'
$oFCKeditor->Width='600';
$oFCKeditor->Height='400';
$oFCKeditor->Value = '<p>This is some <strong>sample text</strong>. You are using <a href="http://www.fckeditor.net/">FCKeditor</a>.</p>' ;
$this->view->fckeditor = $oFCKeditor; //->Create() ; //in this controller, not to call FCKeditor->Create(), call it must in view page
$this->render();
}
2.在 fcke.phtml 中:
<form name="test" action="/test/getfck" method="POST">
<ul>
<li>用户: <input type="text" name="userName" value="" /></li>
<li>密码: <input type="password" name="password" value="" /></li>
<li>
<?php
echo $this->fckeditor->Create();
?>
</li>
</ul>
<ul>
<li><input type="submit" value="提交" /><input type="reset" value="取消" /></li>
</ul>
</form>
二、获得表单值:
1.控制器中的动作
public function getfckAction(){
$this->view->userName=$sUser=$_POST['userName'];
$this->view->password=$_POST['password'];
$this->view->fckeValue =$_POST['FCKeditor1'];
$this->render();
}
$this->view->userName=$sUser=$_POST['userName'];
$this->view->password=$_POST['password'];
$this->view->fckeValue =$_POST['FCKeditor1'];
$this->render();
}
2. getfck.phtml
<?php
echo $this->escape($this->userName).'<br/>';
echo $this->escape($this->password).'<br/>';
echo $this->fckeValue.'<br/>'; //the FCKeditor already call htmlspecialchars() in fckeditor_5.php, not to use escape() on the view page;
?>
echo $this->escape($this->userName).'<br/>';
echo $this->escape($this->password).'<br/>';
echo $this->fckeValue.'<br/>'; //the FCKeditor already call htmlspecialchars() in fckeditor_5.php, not to use escape() on the view page;
?>
三、关键事项:
1.
在 fckeditor 目录、你要放上传文件的 userfiles 目录,以及其它不用解析的public 目录(我的这三个目录同入口文件 index.php 一起放在html 目录下)里要加上 .htaccess 文件,如下:
RewriteEngine Off
2.
图片上传:
功能开启
编辑 fckeditor/editor/filemanager/connectors/php/config.php
$Config[’Enabled’] = true ;
四、在FCKeditor 2.6中。发现在上传文件过程中,通过浏览服务器按钮打开的页面来上传,与直接点上传按钮后,这两种情况会有不同的结果---传到服务器不同的目录里,前者要传到 image 目录下,后者却直接传到
userfiles 目录下,可能是个 bug。
- FCKeditor 2.6 在PHP+Zend Frameword 中的使用
- FCKEditor在PHP中的使用(FCKEditor入门)与配置
- FCKeditor在PHP+SMARTY中的使用
- FCKeditor在PHP+SMARTY中的使用
- FckEditor在Extjs中的使用
- 在PHP中使用功能强大的FCKeditor
- FCKeditor在ASP配置环境中的使用
- FCKEditor 在ASP.NET中的使用
- FCKEditor在ASP.NET中的使用
- FCKeditor在JSP页面中的使用
- FCKeditor在ASP配置环境中的使用
- FCKeditor在smarty中的使用一例
- 关于FCKeditor在.net中的使用
- FCKeditor在ASP设置环境中的使用
- 关于FCKeditor在.net中的使用
- FCKeditor在JSP开发中的使用11
- FCKeditor使用小结(php)
- fckeditor php使用配置
- 筛选法的应用-淡淡的冰-搜狐博客
- static关键字用法小结【转帖】
- 我的简历
- pushlet 2.0.3 源码分析(服务器端)
- URL和HTML编码
- FCKeditor 2.6 在PHP+Zend Frameword 中的使用
- 对《C/C++ 程序设计员应聘常见面试试题深入剖析》的勘误
- 经典sql
- 李开复 算法的力量
- Ant快速上手
- 与或运算
- ubuntu上netbeans6.1在desktop application的小问题
- 标题
- csdn里如何删除以前上传的文件