API15

API15:JEditor/save

From Joomla! Documentation

Revision as of 22:21, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Save the editor content <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Save the editor content

[Edit Descripton]

Template:Description:JEditor/save

Syntax

save($editor)
Parameter Name Default Value Description
$editor The name of the editor control

Defined in

libraries/joomla/html/editor.php

Importing

jimport( 'joomla.html.editor' );

Source Body

function save( $editor )
{
        $this->_loadEditor();

        //check if editor is already loaded
        if(is_null(($this->_editor))) {
                return;
        }

        $args[] = $editor;
        $args['event'] = 'onSave';

        $return = '';
        $results[] = $this->_editor->update($args);
        foreach ($results as $result) {
                if (trim($result)) {
                        $return .= $result;
                }
        }
        return $return;
}

[Edit See Also] Template:SeeAlso:JEditor/save

Examples

<CodeExamplesForm />