/** * Method to render the layout. * * @param array $displayData Array of properties available for use inside the layout file to build the displayed output * * @return string The necessary HTML to display the layout * * @since 3.0 */ public function render($displayData = array()) { $this->clearDebugMessages(); // Inherit base output from parent class $layoutOutput = parent::render($displayData); // Automatically merge any previously data set if $displayData is an array if (is_array($displayData)) { $displayData = array_merge($this->data, $displayData); } // Check possible overrides, and build the full path to layout file $path = $this->getPath(); if ($this->isDebugEnabled()) { echo "<pre>" . $this->renderDebugMessages() . "</pre>"; } // Nothing to show if (empty($path)) { return $layoutOutput; } ob_start(); include $path; $layoutOutput .= ob_get_contents(); ob_end_clean(); return $layoutOutput; }
/** * Tests the render method * * @return void * * @since 3.0 */ public function testRender() { $this->assertThat($this->object->render('Data'), $this->equalTo(''), 'JLayoutBase::render does not render an output'); }
/** * @testdox JLayoutBase->render() returns an empty string. * * @since 3.3.7 */ public function testRenderReturnsAnEmptyString() { $this->assertEquals('', $this->layoutBase->render('Data'), 'JLayoutBase::render does not render an output'); }
/** * Render the list of debug messages * * @return string Output text/HTML code * * @since 3.3 */ public function renderDebugMessages() { if ($this->options->get('debug', false)) { return "<pre>" . parent::renderDebugMessages() . "</pre>"; } return; }