PHP Class WysiwygAppHelper

WysiwygAppHelper encloses all methods needed while working with HTML pages.
Inheritance: extends AppHelper
显示文件 Open project: josegonzalez/cakephp-wysiwyg Class Usage Examples

Public Properties

Property Type Description
$helpers array Helper dependencies

Protected Properties

Property Type Description
$_helperOptions public $helpers = array( 'Wysiwyg.Tinymce' => array( 'theme_advanced_toolbar_align' => 'right', ) );
$_initialized boolean Whether helper has been initialized once or not

Public Methods

Method Description
__construct ( View $View, array $settings = [] ) : void Sets the $this->helper to the helper configured in the session
input ( string $fieldName, array $options = [], array $helperOptions = [] ) : string Creates an fckeditor input field
textarea ( string $fieldName, array $options = [], array $helperOptions = [] ) : string Creates an fckeditor textarea

Protected Methods

Method Description
_initializationOptions ( array $options = [] ) : string Returns a json string containing helper settings
_initialize ( array $options = [] ) : void Initialize the helper css and js for a given input field

Method Details

__construct() public method

Sets the $this->helper to the helper configured in the session
public __construct ( View $View, array $settings = [] ) : void
$View View The View this helper is being attached to.
$settings array Configuration settings for the helper.
return void

_initializationOptions() protected method

Returns a json string containing helper settings
protected _initializationOptions ( array $options = [] ) : string
$options array array of Wysiwyg editor settings
return string json_encoded array of options

_initialize() protected method

Initialize the helper css and js for a given input field
protected _initialize ( array $options = [] ) : void
$options array array of css files, javascript files, and css text to enqueue
return void

input() public method

Creates an fckeditor input field
public input ( string $fieldName, array $options = [], array $helperOptions = [] ) : string
$fieldName string This should be "Modelname.fieldname"
$options array Each type of input takes different options.
$helperOptions array Each type of wysiwyg helper takes different options.
return string An HTML input element with Wysiwyg Js

textarea() public method

Creates an fckeditor textarea
public textarea ( string $fieldName, array $options = [], array $helperOptions = [] ) : string
$fieldName string This should be "Modelname.fieldname"
$options array Each type of input takes different options.
$helperOptions array Each type of wysiwyg helper takes different options.
return string An HTML textarea element with Wysiwyg Js

Property Details

$_helperOptions protected_oe property

public $helpers = array( 'Wysiwyg.Tinymce' => array( 'theme_advanced_toolbar_align' => 'right', ) );
protected $_helperOptions

$_initialized protected_oe property

Whether helper has been initialized once or not
protected bool $_initialized
return boolean

$helpers public_oe property

Helper dependencies
public array $helpers
return array