How to add CKEditor to Sonata Admin backend's textareas

ckeditor, sonata-admin, symfony, textarea

Solution

The solution of zizoujab was totally correct, so I upvoted it. But, as my question refered to SonataAdminBundle, there need to be done a little more. That's why I give this additional answer.

I solved this by overriding the `SonataAdminBundle:CRUD:edit.html.twig` in a custom bundle:

{% extends 'SonataAdminBundle:CRUD:base_edit.html.twig' %}

{% block javascripts %}
{{ parent() }}
<script src="{{ asset('js/ckeditor/adapter/jquery.js') }}" type="text/javascript"></script>
    <script src="{{ asset('js/ckeditor/ckeditor.js') }}" type="text/javascript"></script>
    <script type="text/javascript">
        $(function() {
            $('textarea.ckeditor').ckeditor();
        });
    </script>
{% endblock %}

Also I had the problem, that this didn't work because of the version of ckeditor I used. I was not able to use the one, CmfCreateBundle installs. This generated some js errors and the `<textarea>` tag vanished. So I had to download the "standard" version from ckeditor.com, which worked.

Problem

I'd like to add CKEditor to the Sonata Admin backend. For now I only have Create Bundle running, which allows me to edit the content inline, but I'd like to use an editor in the backend too. I tried Formatter Widget, but it is a little oversized, since I do not want to create new fields in my entities. Has anyone done this already?

Original source