我想在我的 Symfony 2 项目中使用 CK Editor。我下载了 zip 文件,解压缩并将其放在我的 js 文件夹中,我将它包含在我想要编辑器的页面中。我正在关注这个问题Click Here现在我被困在第 6 步。如何在我的 twig 模板中包含该 php。
第 6 步中需要包含的 php 是
<?php
// Make sure you are using a correct path here.
include_once 'ckeditor/ckeditor.php';
$ckeditor = new CKEditor();
$ckeditor->basePath = '/ckeditor/';
$ckeditor->config['filebrowserBrowseUrl'] = '/ckfinder/ckfinder.html';
$ckeditor->config['filebrowserImageBrowseUrl'] = '/ckfinder/ckfinder.html?type=Images';
$ckeditor->config['filebrowserFlashBrowseUrl'] = '/ckfinder/ckfinder.html?type=Flash';
$ckeditor->config['filebrowserUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
$ckeditor->config['filebrowserImageUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images';
$ckeditor->config['filebrowserFlashUploadUrl'] = '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';
$ckeditor->editor('CKEditor1');
?>
我可以用包含 html 的任何变量替换名称并将其从控制器传递给查看吗?
谢谢