本文整理匯總了PHP中JDocumentHtml::loadRenderer方法的典型用法代碼示例。如果您正苦於以下問題:PHP JDocumentHtml::loadRenderer方法的具體用法?PHP JDocumentHtml::loadRenderer怎麽用?PHP JDocumentHtml::loadRenderer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JDocumentHtml
的用法示例。
在下文中一共展示了JDocumentHtml::loadRenderer方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testRender
/**
* Test JDocumentRendererHtmlModules::render
*
* @return void
*
* @since 3.6
*/
public function testRender()
{
$document = new JDocumentHtml();
$renderer = $document->loadRenderer('modules');
$params = array('name' => 'position-0', 'style' => 'xhtml');
$this->callbackExecuted = false;
$output = $renderer->render('position-0', $params);
$htmlClean = trim(preg_replace('~>\\s+<~', '><', $output));
$this->assertTrue($this->callbackExecuted, 'onAfterRenderModules event is not executed');
$html = '<div class="moduletable"><h3>Search</h3><div class="search mod_search63">' . '<form action="index.php" method="post" class="form-inline">' . '<label for="mod-search-searchword63" class="element-invisible">Search ...</label>' . '<input name="searchword" id="mod-search-searchword63" maxlength="200" ' . 'class="inputbox search-query" type="search" size="20" placeholder="Search ..." />' . '<input type="hidden" name="task" value="search" /><input type="hidden" name="option" value="com_search" />' . '<input type="hidden" name="Itemid" value="" /></form></div></div>';
$this->assertEquals($html, $htmlClean, 'render output does not match expected content');
}