WYSIWYG

class Nos\Renderer_Wysiwyg
Extends Nos\Renderer.
This renderer is used to display a WYSIWYG editor.
It’s based on TinyMCE.
Wysiwyg UI

Configuration

Any options for the TinyMCE WYSIWYG editor. See the TinyMCE documentation for all available options.

Methods

Nos\Renderer_Wysiwyg::renderer($renderer)
Parameters:
  • $renderer (Model) – HTML attributes (name, class, id, value, etc.), with a special key renderer_options
Returns:

The <textarea> tag with JavaScript to initialise it

Displays a TinyMCE WYSIWYG editor in a standalone manner.

Example

Adding a WYSIWYG in a CRUD form configuration:

<?php

return array(
    'label' => '',
    'renderer' => 'Nos\Renderer_Wysiwyg',
    'renderer_options' => array(
            // TinyMCE options
    ),
);

Displaying a WYSIWYG editor:

<?php

echo Nos\Renderer_Wysiwyg::renderer(array(
    'name' => 'my_wysiwyg',
    'value' => '<p>My contents</p>',
    'renderer_options' => array(
            // TinyMCE options
    ),
));