Getting started with FOSCKEditorBundle
Edit this pageWarning: You are browsing the documentation for version 1.x which is not maintained anymore.
If some of your projects are still using this version, consider upgrading.
Getting started with FOSCKEditorBundle
Overview
The bundle integrates CKEditor into Symfony via the Form Component. It
automatically registers a new type called ckeditor
which can be fully
configured. This type extends the textarea one, meaning all textarea options
are available.
Here, an example where we customize the CKEditor config:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
// Symfony 2.7 and previous versions
$builder->add('field', 'ckeditor', array(
'config' => array(
'uiColor' => '#ffffff',
//...
),
));
// Symfony 2.8 and newer versions
use FOS\CKEditorBundle\Form\Type\CKEditorType;
$builder->add('field', CKEditorType::class, array(
'config' => array(
'uiColor' => '#ffffff',
//...
),
));
Note
If you're using PHP < 5.5 and Symfony 2.8+, you must rely on
FOS
instead of
CKEditorType::class
as this constant does not exist.
Installation
To install the bundle, please, read the Installation documentation.
Migration from IvoryCKEditorBundle to FOSCKEditorBundle
As IvoryCKEditorBundle was abandoned, FriendsOfSymfony took this bundle over, to help you easily migrate just follow our guide.
Usage
If you want to learn more, this documentation covers the following use cases:
- CKEditor Installation
- Define reusable configuration
- Customize the toolbar
- Manage CKEditor loading
- Manage language
- How to handle file browse/upload
- jQuery adapter
- JsonBuilder
- RequireJS Support
- Append Custom Javascript
- Synchronize the textarea
- Fallback to textarea
- Disable auto inline
- Use inline editing
- Plugin support
- Skin support
- Style support
- Template support
- Use your own CKEditor