there are two lines in this function
Code: Select all
public function render($xml)
{
if (isset($this->quote_helper))
{
$xml = $this->quote_helper->inject_metadata($xml);
}
$renderer = $this;
/**
* Modify a parsed text before it is rendered
*
* @event core.text_formatter_s9e_render_before
* @var \phpbb\textformatter\s9e\renderer renderer This renderer service
* @var string xml The parsed text, in its XML form
* @since 3.2.0-a1
*/
$vars = array('renderer', 'xml');
extract($this->dispatcher->trigger_event('core.text_formatter_s9e_render_before', compact($vars)));
$html = $this->renderer->render($xml);
if (isset($this->censor) && $this->viewcensors)
{
$html = $this->censor->censorHtml($html, true);
}
/**
* Modify a rendered text
*
* @event core.text_formatter_s9e_render_after
* @var string html The rendered text's HTML
* @var \phpbb\textformatter\s9e\renderer renderer This renderer service
* @since 3.2.0-a1
*/
$vars = array('html', 'renderer');
extract($this->dispatcher->trigger_event('core.text_formatter_s9e_render_after', compact($vars)));
return $html;
}
Code: Select all
$renderer = $this;
Code: Select all
$html = $this->renderer->render($xml);
But the var_dump output shows these $renderer and $this->renderer are different objects.
I hadn't programmed PHP for like 6 years so my knowledges are quite outdated, could someone help me to understand this code?
Many thanks!