CakePHP 把ckfinder不作为controller的配置

CakePHP是MVC的架构模型,并且约定了controller出现的位置,所以它会在你集成完ckfinder后把ckfinder.html作为controller处理的异常.为了解决这个问题你需要在app/config/routes.php中作如下配置:

/**
* bypass MVC interpret url that contain "ckfinder.html"
*/
Router::connect
(
'/:ckfinder.html',
array
(
'ckfinder.html' => 'ckfinder.html[a-zA-Z\-_]+'
)
);


另外我还遇到一个问题,就是当我用ckfinder上传完文件后在编辑器中显示不出来,也是类似把目录认成了controller,这种情况一般是因为你在ckfinder的config.php中配置的basedir有误造成的:

/*
$baseDir : the path to the local directory (in the server) which points to the
above $baseUrl URL. This is the path used by CKFinder to handle the files in
the server. Full write permissions must be granted to this directory.

Examples:
// You may point it to a directory directly:
$baseDir = '/home/login/public_html/ckfinder/files/';
$baseDir = 'C:/SiteDir/CKFinder/userfiles/';

// Or you may let CKFinder discover the path, based on $baseUrl:
$baseDir = resolveUrl($baseUrl);

ATTENTION: The trailing slash is required.
*/
#$baseDir = resolveUrl($baseUrl);
$baseDir = 'e:/myphp/linkwiki/app/webroot/userfiles/'.$userName.'/';


如果你把这个路径配置错误的话,你用类似这个url访问:
http://localhost/linkwiki/userfiles/lime/images/DSCF0040.jpg
就会报没有找到userfile这个controller的错误。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值