我刚刚注意到我的CKEditor不再起作用。自从我没去过我网站上使用CKEditor的页面以来已经过了几天。 但是事实在那里。我只有一个简单的Textaera而不是CKEditor工具。
有没有办法查看问题的根源?
我的AppKernel.php:
$bundles = [
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new AppBundle\AppBundle(),
new Site\PagesBundle\PagesBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new Vich\UploaderBundle\VichUploaderBundle(),
new FOS\UserBundle\FOSUserBundle(),
new FOS\CKEditorBundle\FOSCKEditorBundle(),
new Besancon\AuthBundle\BesanconAuthBundle(),
new JMS\SerializerBundle\JMSSerializerBundle(),
];
我的config.yml的一部分:
fos_ck_editor:
configs:
my_config:
toolbar: [ ["Source", "-", "Save"], "/", ["Anchor"], "/", ["Maximize"] ]
uiColor: "#000000"
formType:
<?php
namespace Site\PagesBundle\Form;
use Symfony\Component\Form\AbstractType;
use FOS\CKEditorBundle\Form\Type\CKEditorType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\RangeType;
class InformationType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('titre',TextType::class,array(
'attr' => array(
'placeholder'=> 'Titre de l\'information',
'class'=>'form-control'
)
))
->add('contenu', CKEditorType::class, array(
'config' => array(
'uiColor' => '#ffffff',
'toolbar'=>'full'
),))
->add('zone',ChoiceType::class, array(
'choices'=> array(
'Zone 1'=>'Zone 1',
'Zone 2'=>'Zone 2',
'Zone 3'=>'Zone 3',
),
))
->add('criticite', RangeType::class, array(
'label'=> 'Taux de criticité',
'attr'=>array(
'list'=> 'tauxCriticite'
)
))
;
}
还有树枝文件:
{% extends 'base.html.twig' %}
{% block body %}
<h1>Information creation</h1>
{{ form_start(form) }}
{{form_row (form.titre)}}
{{form_row (form.zone)}}
{{form_row (form.contenu)}}
{{form_row (form.criticite)}}
<datalist id="tauxCriticite">
<option value="0" label="0%">
<option value="10">
<option value="20">
<option value="30">
<option value="40">
<option label="50" value="50">
<option value="60">
<option value="70">
<option value="80">
<option value="90">
<option value="100" label="100%">
</datalist>
<input class="btn btn-primary" type="submit" value="Ajouter"/>
<a href="{{path('informations_index')}}" class="btn btn-primary">Retour</a>
{{ form_end(form) }}
{% endblock %}
那么,我们同意这不是配置问题吗?
编辑:我还添加了一个事实,即我的捆绑包中有ckeditor捆绑包,并且在“ web”文件夹中也有ckeditor文件夹