本文整理汇总了PHP中HtmlElement::render方法的典型用法代码示例。如果您正苦于以下问题:PHP HtmlElement::render方法的具体用法?PHP HtmlElement::render怎么用?PHP HtmlElement::render使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HtmlElement
的用法示例。
在下文中一共展示了HtmlElement::render方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: smarty_block_menuItem
/**
* Smarty block plugin, for generating page menu item
* This block must always be called in pageMenu block context
*
* @param array $params
* @param Smarty $smarty
* @param $repeat
*
* <code>
* {pageMenu id="menu"}
* {menuItem}
* {menuCaption}Click Me{/menuCaption}
* {menuAction}http://click.me.com{/menuAction}
* {/menuItem}
* {menuItem}
* {menuCaption}Another menu item{/menuCaption}
* {pageAction}alert('Somebody clicked on me too!'){/menuAction}
* {/menuItem}
* {/pageMenu}
* </code>
*
* @package application.helper.smarty
* @author Integry Systems
*/
function smarty_block_menuItem($params, $content, LiveCartSmarty $smarty, &$repeat)
{
if ($repeat) {
$smarty->clear_assign('menuCaption');
$smarty->clear_assign('menuAction');
$smarty->clear_assign('menuPageAction');
} else {
$item = new HtmlElement('a');
if ($smarty->get_template_vars('menuAction')) {
$href = $smarty->get_template_vars('menuAction');
} else {
if ($smarty->get_template_vars('menuPageAction')) {
$onClick = $smarty->get_template_vars('menuPageAction');
$href = '#';
$item->setAttribute('onClick', $onClick . '; return false;');
}
}
$item->setAttribute('href', $href);
// EXPERIMENTAL - set access key for menu item
$caption = $smarty->get_template_vars('menuCaption');
if (FALSE != strpos($caption, '&&')) {
$p = strpos($caption, '&&');
$accessKey = substr($caption, $p + 2, 1);
$item->setAttribute('accessKey', $accessKey);
$caption = substr($caption, 0, $p + 3) . '</span>' . substr($caption, $p + 3);
$caption = substr($caption, 0, $p) . '<span class="accessKey">' . substr($caption, $p + 2);
}
$item->setContent($caption);
$smarty->append('pageMenuItems', $item->render());
}
}
示例2: getData
public function getData()
{
$listHtml = array('<ul>');
$li = new HtmlElement('li');
foreach ($this->content as $key => $value) {
$li->setAttribute('id', $key);
$li->setContent($value);
$listHtml[] = $li->render();
}
$listHtml[] = '</ul>';
return implode("\n", $listHtml);
}
示例3: smarty_block_pageMenu
/**
* Smarty block plugin, for generating page menus
*
* @param array $params
* @param Smarty $smarty
* @param $repeat
*
* <code>
* {pageMenu id="menu"}
* {menuItem}
* {menuCaption}Click Me{/menuCaption}
* {menuAction}http://click.me.com{/menuAction}
* {/menuItem}
* {menuItem}
* {menuCaption}Another menu item{/menuCaption}
* {pageAction}alert('Somebody clicked on me too!'){/menuAction}
* {/menuItem}
* {/pageMenu}
* </code>
*
* @return string Menu HTML code
* @package application.helper.smarty
* @author Integry Systems
*/
function smarty_block_pageMenu($params, $content, LiveCartSmarty $smarty, &$repeat)
{
if ($repeat) {
$smarty->clear_assign('pageMenuItems');
} else {
$items = $smarty->get_template_vars('pageMenuItems');
$menuDiv = new HtmlElement('div');
$menuDiv->setAttribute('id', $params['id']);
$menuDiv->setAttribute('tabIndex', 1);
$menuDiv->setContent(implode(' | ', $items));
return $menuDiv->render();
}
}
示例4: render
/**
* {@inheritdoc}
*/
public function render()
{
$this->content = $this->phtmlRender();
return parent::render();
}
示例5: render
public function render()
{
$this->setAttribute('onkeyup', $this->getValidator()->getJavaScriptCode());
return parent::render();
}
示例6: render
/**
* Render
*
* @return void
*/
function render()
{
$this->jsButtonSet();
parent::render();
}
示例7: render
function render()
{
$this->js(true)->buttonset();
parent::render();
}
示例8: render
function render()
{
$this->addStyle('float', $this->float);
parent::render();
}
示例9: render
public function render()
{
global $_CORELANG;
// if no child with name input and type submit is present, add one
$hasSubmit = false;
foreach ($this->getChildren() as $child) {
if ($child->getName() == 'input' && $child->getAttribute('type') == 'submit') {
$hasSubmit = true;
break;
}
}
if (!$hasSubmit && $this->addButtons) {
$submitDiv = new FieldsetElement();
$submitDiv->setAttribute('class', 'actions');
$submit = new HtmlElement('input');
$submit->setAttribute('type', 'submit');
$submit->setAttribute('value', $_CORELANG['TXT_SAVE']);
$submitDiv->addChild($submit);
if (!empty($this->cancelUrl)) {
$cancel = new HtmlElement('input');
$cancel->setAttribute('type', 'button');
$cancel->setAttribute('value', $_CORELANG['TXT_CANCEL']);
$cancel->setAttribute('onclick', 'location.href="' . $this->cancelUrl . '&csrf=' . \Cx\Core\Csrf\Controller\Csrf::code() . '"');
$submitDiv->addChild($cancel);
}
$this->addChild($submitDiv);
}
return parent::render();
}
示例10: render
function render()
{
$this->setWidthHeight();
parent::render();
}
示例11: renderOuter
/**
* @return array
*/
public function renderOuter() : array
{
HtmlElement::setContent('[-INNER-]');
$render = HtmlElement::render();
return explode('[-INNER-]', $render);
}