感谢你来到这里
我真的很激动
盼望,能有你的支持
捐赠可扫描二维码转账支付
支付宝扫一扫付款
微信扫一扫付款
(微信为保护隐私,不显示你的昵称)
EN本篇文档待译。点击查看官方英文原档。我们将很快返回这里,敬请期待。
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 Ivory\CKEditorBundle\Form\Type\CKEditorType;
$builder->add('field', CKEditorType::class, array(
'config' => array(
'uiColor' => '#ffffff',
//...
),
)); |
If you're using PHP < 5.5 and Symfony 2.8+, you must rely on
Ivory\CKEditorBundle\Form\Type\CKEditorType
instead of
CKEditorType::class
as this constant does not exist.
To install the bundle, please, read the Installation documentation.
本文,包括例程代码在内,采用的是 Creative Commons BY-SA 3.0 创作共用授权。