Back to Editor class

Method display

public string
display
(mixed $name, mixed $html, mixed $width, mixed $height, mixed $col, mixed $row, mixed $buttons = true, mixed $id = null, mixed $asset = null, mixed $author = null, mixed $params = array())
Display the editor area.
Parameters
  • string $name The control name.
  • string $html The contents of the text area.
  • string $width The width of the text area (px or %).
  • string $height The height of the text area (px or %).
  • int $col The number of columns for the textarea.
  • int $row The number of rows for the textarea.
  • bool $buttons True and the editor buttons will be displayed.
  • string $id An optional ID for the textarea (note: since 1.6). If not supplied the name is used.
  • string $asset The object asset
  • object $author The author.
  • array $params Associative array of editor parameters.
Returns
  • string
Since
  • 1.5
Class: Editor
Project: Joomla

Method display - Source code

/**
 * Display the editor area.
 *
 * @param   string   $name     The control name.
 * @param   string   $html     The contents of the text area.
 * @param   string   $width    The width of the text area (px or %).
 * @param   string   $height   The height of the text area (px or %).
 * @param   integer  $col      The number of columns for the textarea.
 * @param   integer  $row      The number of rows for the textarea.
 * @param   boolean  $buttons  True and the editor buttons will be displayed.
 * @param   string   $id       An optional ID for the textarea (note: since 1.6). If not supplied the name is used.
 * @param   string   $asset    The object asset
 * @param   object   $author   The author.
 * @param   array    $params   Associative array of editor parameters.
 *
 * @return  string
 *
 * @since   1.5
 */
public function display($name, $html, $width, $height, $col, $row, $buttons = true, $id = null, $asset = null, $author = null, $params = array())
{
    $this->asset = $asset;
    $this->author = $author;
    $this->_loadEditor($params);
    // Check whether editor is already loaded
    if ($this->_editor === null) {
        Factory::getApplication()->enqueueMessage(Text::_('JLIB_NO_EDITOR_PLUGIN_PUBLISHED'), 'danger');
        return;
    }
    // Backwards compatibility. Width and height should be passed without a semicolon from now on.
    // If editor plugins need a unit like "px" for CSS styling, they need to take care of that
    $width = str_replace(';', '', $width);
    $height = str_replace(';', '', $height);
    $args['name'] = $name;
    $args['content'] = $html;
    $args['width'] = $width;
    $args['height'] = $height;
    $args['col'] = $col;
    $args['row'] = $row;
    $args['buttons'] = $buttons;
    $args['id'] = $id ?: $name;
    $args['asset'] = $asset;
    $args['author'] = $author;
    $args['params'] = $params;
    return \call_user_func_array(array($this->_editor, 'onDisplay'), $args);
}