CKEditor form element.

Allows setting path to ckeditor files and setting config variables. Default config is to have bbcode output and only a small subset of available buttons on the toolbars.

package Gems
subpackage Form
author Menno Dekker
copyright Copyright (c) 2014 Erasmus MC
license New BSD License
version $Id$

 Methods

Constructor

__construct(string|array|\Zend_Config $spec, array|\Zend_Config $options = null) : void

$spec may be:

  • string: name of element
  • array: options with which to configure element
  • \Zend_Config: \Zend_Config with options for configuring element

Parameters

$spec

stringarray\Zend_Config

$options

array\Zend_Config

Exceptions

\Zend_Form_Exception if no element name after initialization

init()

init() 

Load default decorators

loadDefaultDecorators() : \Zend_Form_Element

Returns

\Zend_Form_Element

Set the path to the public files of the CKEditor

setBasePath(string $basePath) : \CKEditor_Form_CKEditor

Parameters

$basePath

string

Returns

\CKEditor_Form_CKEditor

Set the configuration for the CKEditor

setCKConfig(string|array $key, mixed $value = null

ARRAY Use array as first parameter to set all items at once. This will overwrite the existing config. Use false as second parameter to ADD to the existing config

STRING or use a string to set items one by one, the second parameter is the value

Parameters

$key

stringarray

$value

mixed

Set the view object

setView(\Zend_View_Interface $view = null) : \CKEditor_Form_CKEditor

Ensures that the view object has the CKEditor view helper path set.

Parameters

$view

\Zend_View_Interface

Returns

\CKEditor_Form_CKEditor

Add a class to an existing class, taking care of spacing

addClass(string $addClass) 

Parameters

$addClass

string

the Class or classes to add, seperated by spaces

 Properties

 

The path to the public files of the CKEditor

$basePath : string

Default

''
 

Holds the config array for CKEditor

$config : array

Default

array('extraPlugins' => 'bbcode', 'toolbar' => array(array('Source', '-', 'Undo', 'Redo'), array('Find', 'Replace', '-', 'SelectAll', 'RemoveFormat'), array('Link', 'Unlink', 'Image', 'SpecialChar'), '/', array('Bold', 'Italic', 'Underline'), array('NumberedList', 'BulletedList', '-', 'Blockquote'), array('Maximize')))
 

Use formTextarea view helper by default

$helper : string

Default

'formCKEditor'
 

Bootstrap class for an input tag. Remove if you want the normal layout.

$_elementClass : string

Default

'form-control'