joomla/joomla-cms — pull request #628 by shumisha (2013-01-02 13:14:47+00:00)
Title: Add jlayout helper

This is a proposal to add an helper class to simplify rendering JLayoutFile layouts, replacing:

$layout = new JLayoutFile($layoutFile, $basePath);
$renderedLayout = $layout->render($displayData);

with:
$renderedHtml = JLayoutHelper::renderFile('id.of.layout.file', $data);

Should be used when the $layout object is only used once when rendering a page. If the same layout object is used several times, being fed various data, then the helper is of no use.

In this PR, JHtmlSidebar has been modified to make use of the helper, so to test the change, one only needs to apply and checks that the output of all backend extensions is unchanged.

Important: bug fix in https://github.com/joomla/joomla-cms/pull/621 MUST be applied prior to trying to use this change