JEditor/setContent: Difference between revisions
From Joomla! Documentation
m removing red link to edit, no existant pages |
m preparing for archive only |
||
| Line 58: | Line 58: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=setContent | category=setContent | ||
category=JEditor | category=JEditor | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 00:33, 25 March 2017
Description
Set the editor contents
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
setContent($editor, $html)
| Parameter Name | Default Value | Description |
|---|---|---|
| $editor | The name of the editor control | |
| $html | The contents of the text area |
Defined in
libraries/joomla/html/editor.php
Importing
jimport( 'joomla.html.editor' );
Source Body
function setContent( $editor, $html )
{
$this->_loadEditor();
$args['name'] = $editor;
$args['html'] = $html;
$args['event'] = 'onSetContent';
$return = '';
$results[] = $this->_editor->update($args);
foreach ($results as $result) {
if (trim($result)) {
$return .= $result;
}
}
return $return;
}
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
Code Examples