我正在使用elFinder来管理网站的资产,它的默认功能非常好用;但是我需要添加一些额外的逻辑来驻留在我的控制器上的几个PHP函数。elFinder覆盖'rm'PHP
,我想加入的逻辑的地方是在功能_unlink($path)
前一个文件被删除实际上我想打电话到另一个阶级消灭数据库条目此资产<elfinder_Dir>/PHP/elFinderVolumeLocalFileSystem.php
明确。
原有的功能如下:
protected function _unlink($path) {
return @unlink($path);
}
当我尝试添加如下代码如下:
protected function _unlink($path) {
var_dump($path);
return @unlink($path);
}
OR
//top of file...
use controllers\ResourceManager;
//OR
//include <pathToResourceManager>
//...
protected function _unlink($path) {
ResourceManager::delteFromDB();
return @unlink($path);
}
我收到了屏幕上此警报:
我还注意到,给定该消息时,在我的“网络”标签报头示出了如预期由elFinder的JS部分的响应头的Content-type的text/html
代替application/json
。
为什么在添加自定义逻辑时,标题Content-type会被更改? 有没有更好的方法来将此功能添加到项目中?