我已经下载并安装了 CKfinder 3.5.1.2 laravel 包。我还为我的 CKeditor 创建了一个自定义构建。到目前为止,一切都很好。
这是我的测试页面。
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<title>CKEditor 5 ClassicEditor build + CKfinder</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
@include('ckfinder::setup')
<div>
<textarea class="textarea " id="editor">
<h2>Hello</h2>
</textarea>
</div>
<script src="/public/ckeditor/ckeditor.js"></script>
<script src="/public/ckeditor/ckfinder.js"></script>
<script>CKFinder.config( { connectorPath: '/public/ckfinder/connector' } );</script>
<script type="text/javascript">
ClassicEditor
.create( document.querySelector( '#editor' ), {
ckfinder: {
uploadUrl: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files&responseType=json'
},
toolbar: {
items: [
'sourceEditing','heading','bold','italic','subscript','superscript','specialCharacters','|',
'fontFamily','fontSize','fontColor','fontBackgroundColor','|',
'alignment','indent','outdent','numberedList','bulletedList','|',
'link','insertTable','|',
'imageUpload','imageInsert','CKFinder','mediaEmbed','|',
'findAndReplace','highlight','removeFormat','undo','redo'
]
},
language: 'en-gb',
image: {
toolbar: [
'imageTextAlternative','imageStyle:inline','imageStyle:block','imageStyle:side'
]
},
table: {
contentToolbar: [
'tableColumn','tableRow','mergeTableCells','tableCellProperties','tableProperties'
]
},
licenseKey: '',
} )
.then( editor => {
window.editor = editor;
} )
.catch( error => {
console.error( error );
} )
;
</script>
</body>
</html>
问题是当我点击 CKfinder 图标时,弹出窗口显示我的主页,没有任何 CSS。
1/ 我没有找到关于如何为 CKfinder 设置 uploadUrl 的明确解释,所以我按照示例中提供的方式保留了它。我猜这个 url 应该指向 connector.php 文件的位置?文件应该放在哪里?
2/ 在 vendor/ckfinder-laravel-package 中,routes.php 包含以下路由:
Route::any('/ckfinder/connector', '\CKSource\CKFinderBridge\Controller\CKFinderController@requestAction')
->name('ckfinder_connector');
Route::any('/ckfinder/browser', '\CKSource\CKFinderBridge\Controller\CKFinderController@browserAction')
->name('ckfinder_browser');
Route::any('/ckfinder/examples/{example?}', '\CKSource\CKFinderBridge\Controller\CKFinderController@examplesAction')
->name('ckfinder_examples');
我应该将这些路由复制到我自己的文件中并将“\CKFinderBridge\Controller...”更改为正确的路径吗?