本文整理汇总了PHP中Render::render方法的典型用法代码示例。如果您正苦于以下问题:PHP Render::render方法的具体用法?PHP Render::render怎么用?PHP Render::render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Render
的用法示例。
在下文中一共展示了Render::render方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: convert
/**
* @param string $clover
* @param string $target
* @param string $templatePath
*
* @throws \InvalidArgumentException
*/
public function convert($clover, $target, $templatePath = false)
{
if (is_file($clover) === false) {
throw new \InvalidArgumentException(sprintf('"%s" is not a file', $clover));
}
if (is_dir($target) === true) {
throw new \InvalidArgumentException(sprintf('Target must be empty "%s"', $target));
}
$this->render->render($this->hydrator->xmlToDto(simplexml_load_file($clover), new Root()), $target, $templatePath);
}
示例2: getBusinessMessage
public function getBusinessMessage(Render $class, $layout = NULL)
{
if ($layout == 'null') {
$class->layout = $layout;
}
$class->set('mensagem', $this->getMessage());
if ($this->getCode() == 112) {
die($class->render(array('controller' => 'Erros', 'view' => 'notPermisson')));
} else {
if ($this->getCode() == 113) {
die($class->render(array('controller' => 'Erros', 'view' => 'notPermisson')));
} else {
if ($this->getCode() == 114) {
die($class->render(array('controller' => 'Erros', 'view' => 'notPermisson')));
}
}
}
}
示例3: testRenderDefaultDefault
public function testRenderDefaultDefault()
{
$priceType = 'final';
$arguments = ['param' => 15];
$result = 'default.default';
$pricingRender = $this->getMock('Magento\\Framework\\Pricing\\Render', [], [], '', false, true, true, false);
$this->renderPool->expects($this->once())->method('createPriceRender')->will($this->returnValue($pricingRender));
$pricingRender->expects($this->once())->method('toHtml')->will($this->returnValue('default.default'));
$this->priceLayout->expects($this->once())->method('getBlock')->with('render.product.prices')->will($this->returnValue($this->renderPool));
$this->assertEquals($result, $this->model->render($priceType, $this->saleableItem, $arguments));
}
示例4: makeHTML
function makeHTML($indent, $parent, $expandAll, $theme)
{
global $modx;
global $icons, $iconsPrivate, $_style;
global $_lang, $opened, $opened2, $closed2;
//added global vars
global $renderer;
$output = "";
$pad = " ";
// setup spacer
$spacer = "";
for ($i = 1; $i <= $indent; $i++) {
$spacer .= " ";
}
if (!isset($_SESSION['tree_sortby']) && !isset($_SESSION['tree_sortdir'])) {
// This is the first startup, set default sort order
$_SESSION['tree_sortby'] = 'menuindex';
$_SESSION['tree_sortdir'] = 'ASC';
}
$orderby = $modx->db->escape($_SESSION['tree_sortby'] . " " . $_SESSION['tree_sortdir']);
// Folder sorting gets special setup ;) Add menuindex and pagetitle
/*if(in_array($parent, array(1, 2, 3))) $orderby = "pagetitle ASC"; // tree custom sorting*/
if ($_SESSION['tree_sortby'] == 'isfolder') {
$orderby .= ", menuindex ASC, pagetitle";
}
$tblsc = $modx->getFullTableName('site_content');
$tbldg = $modx->getFullTableName('document_groups');
// get document groups for current user
$docgrp = isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups']) ? implode(",", $_SESSION['mgrDocgroups']) : '';
$showProtected = false;
if (isset($modx->config['tree_show_protected'])) {
$showProtected = (bool) $modx->config['tree_show_protected'];
}
$mgrRole = isset($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1' ? '1' : '0';
if ($showProtected == false) {
$access = "AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ")" : " OR dg.document_group IN ({$docgrp}))");
} else {
$access = '';
}
$result = $modx->db->select("DISTINCT sc.id, pagetitle, menutitle, parent, isfolder, published, deleted, type, template, menuindex, donthit, hidemenu, alias, contentType, privateweb, privatemgr,\n\t\t\t\tMAX(IF(1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ({$docgrp})") . ", 1, 0)) AS has_access", "{$tblsc} AS sc LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(parent={$parent}) {$access} GROUP BY sc.id", $orderby);
if ($modx->db->getRecordCount($result) == 0) {
$renderer->setPlaceholder("spacer", $spacer);
$renderer->setPlaceholder("pad", $pad);
$output .= $renderer->render('node_empty');
}
// Make sure to pass in the $modx_textdir variable to the node builder
global $modx_textdir;
$node_name_source = $modx->config['resource_tree_node_name'];
while (list($id, $pagetitle, $menutitle, $parent, $isfolder, $published, $deleted, $type, $template, $menuindex, $donthit, $hidemenu, $alias, $contenttype, $privateweb, $privatemgr, $hasAccess) = $modx->db->getRow($result, 'num')) {
$renderer = new Render();
$renderer->lang = $_lang;
$renderer->style = $_style;
$renderer->ph = array();
$renderer->templatesDir = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates';
switch ($node_name_source) {
case 'menutitle':
$nodetitle = $menutitle ? $menutitle : $pagetitle;
break;
case 'alias':
$nodetitle = $alias ? $alias : $id;
if (strpos($alias, '.') === false) {
if ($isfolder != 1 || $modx->config['make_folders'] !== '1') {
$nodetitle .= $modx->config['friendly_url_suffix'];
}
}
$nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle;
break;
case 'pagetitle':
$nodetitle = $pagetitle;
break;
case 'createdon':
case 'editedon':
case 'publishedon':
case 'pub_date':
case 'unpub_date':
$doc = $modx->getDocumentObject('id', $id);
$date = $doc[$node_name_source];
if (!empty($date)) {
$nodetitle = $modx->toDateFormat($date);
} else {
$nodetitle = '- - -';
}
break;
default:
$nodetitle = $pagetitle;
}
$nodetitle = htmlspecialchars(str_replace(array("\r\n", "\n", "\r"), ' ', $nodetitle));
$protectedClass = $hasAccess == 0 ? ' protectedNode' : '';
$nodetitleDisplay = $published == 0 ? "<span class=\"unpublishedNode\">{$nodetitle}</span>" : ($hidemenu == 1 ? "<span class=\"notInMenuNode{$protectedClass}\">{$nodetitle}</span>" : "<span class=\"publishedNode{$protectedClass}\">{$nodetitle}</span>");
$nodetitleDisplay = $deleted == 1 ? "<span class=\"deletedNode\">{$nodetitle}</span>" : $nodetitleDisplay;
$weblinkDisplay = $type == "reference" ? ' <img src="' . $_style["tree_linkgo"] . '">' : '';
$pageIdDisplay = '<div class="treeNodeId">[ ' . ($modx_textdir ? '‏' : '') . $id . ' ]</div>';
$url = $modx->makeUrl($id);
$alt = !empty($alias) ? $_lang['alias'] . ": " . $alias : $_lang['alias'] . ": -";
$alt .= " " . $_lang['resource_opt_menu_index'] . ": " . $menuindex;
$alt .= " " . $_lang['resource_opt_show_menu'] . ": " . ($hidemenu == 1 ? $_lang['no'] : $_lang['yes']);
$alt .= " " . $_lang['page_data_web_access'] . ": " . ($privateweb ? $_lang['private'] : $_lang['public']);
$alt .= " " . $_lang['page_data_mgr_access'] . ": " . ($privatemgr ? $_lang['private'] : $_lang['public']);
$data = array('id' => $id, 'pagetitle' => $pagetitle, 'menutitle' => $menutitle, 'parent' => $parent, 'isfolder' => $isfolder, 'published' => $published, 'deleted' => $deleted, 'type' => $type, 'menuindex' => $menuindex, 'donthit' => $donthit, 'hidemenu' => $hidemenu, 'alias' => $alias, 'contenttype' => $contenttype, 'privateweb' => $privateweb, 'privatemgr' => $privatemgr, 'hasAccess' => $hasAccess, 'template' => $template, 'nodetitle' => $nodetitle, 'spacer' => $spacer, 'pad' => $pad, 'url' => $url, 'alt' => $alt, 'nodetitleDisplay' => $nodetitleDisplay, 'weblinkDisplay' => $weblinkDisplay, 'pageIdDisplay' => $pageIdDisplay);
$renderer->setPlaceholders($data, "ph.");
//.........这里部分代码省略.........
示例5: getPage
public static function getPage($page)
{
Render::render($page);
return "";
}
示例6: array
<title></title>
</head>
<body>
<?php
include 'vendor/autoload.php';
include 'Render.php';
// init data
$data = array('component1' => array('title' => 'init title', 'content' => 'init content'), 'component2' => array('list' => array(array('data' => 'item 1'), array('data' => 'item 2'))));
$r = new Render(new Mustache_Engine());
?>
<div id="main">
<div content-id="component1">
<?php
echo $r->render('component1', $data['component1']);
?>
</div>
<div content-id="component2">
<?php
echo $r->render('component2', $data['component2']);
?>
</div>
<a href="#" update-content-trigger data-update-url="update.php?sku=10" data-callback="onUpdate">Update content for sku 10</a>
<a href="#" update-content-trigger data-update-url="update.php?sku=7" data-callback="onUpdate">Update content for sku 7</a>
</div>
<?php
// render all js templates which used to render by js
echo $r->renderAllJsTemplates();
?>
示例7: define
<?php
define('RND', true);
require_once 'core/includes.php';
User::startSession();
$getRid = Utilities::getOrNull('rid');
if (DB::isSidExist(User::getSid())) {
// if user has loaded once
User::load();
if ($getRid != null) {
User::$rid = $getRid;
}
} else {
// first time user
User::generate();
}
$data['rid'] = Generator::formatRid(User::$rid);
$data['shortLink'] = SITE . '/prove/' . Generator::formatRid(User::$rid);
$index['token'] = User::$token;
$title['pageName'] = Utilities::getOrNull('route');
Render::render('head', $title);
Render::render('header');
Render::render('section_header', $data);
Render::render('section_index', $index);
Render::render('section_prove');
Render::render('footer');
DB::close();