jquery.rst 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. jQuery adapter
  2. ==============
  3. If your application relies on jQuery, we recommend you to use the jQuery
  4. adapter. The bundle will automatically wrap the CKEditor instantiation into a
  5. ``jQuery(document).ready()`` block making the code more reliable.
  6. Enable the Adapter
  7. ------------------
  8. The CKEditor jQuery adapter is by default not loaded even if the ``autoload``
  9. option is enabled. In order to load it, the ``autoload`` flag must be enabled
  10. and you must explicitly enable the jQuery adapter. You can do it globally in
  11. your configuration:
  12. .. code-block:: yaml
  13. # app/config/config.yml
  14. fos_ck_editor:
  15. jquery: true
  16. Or you can do it in your widget:
  17. .. code-block:: php
  18. $builder->add('field', 'ckeditor', array('jquery' => true));
  19. Use your Adapter
  20. ----------------
  21. Additionally, the jQuery adapter used by default is the one shipped with the
  22. bundle in ``Resources/public/adapters/jquery.js``. If you would prefer use
  23. your own, you can configure it globally in your configuration:
  24. .. code-block:: yaml
  25. # app/config/config.yml
  26. fos_ck_editor:
  27. jquery_path: your/own/jquery.js
  28. Or you can configure it in your widget:
  29. .. code-block:: php
  30. $builder->add('field', 'ckeditor', array('jquery_path' => 'your/own/jquery.js'));
  31. .. note::
  32. Each path must be relative to the web directory.