本文整理汇总了PHP中common_node::parseChildren方法的典型用法代码示例。如果您正苦于以下问题:PHP common_node::parseChildren方法的具体用法?PHP common_node::parseChildren怎么用?PHP common_node::parseChildren使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common_node
的用法示例。
在下文中一共展示了common_node::parseChildren方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mainAction
/**
* main action
*/
public function mainAction()
{
$node_id = $this->GET['node_id'];
$container = $this->GET['container'];
if (!is_numeric($node_id) || !is_numeric($container)) {
return false;
}
require_once 'models/common/common_node.php';
$Node = new common_node();
$content = $Node->parseChildren($node_id, $container);
foreach ($content as $item) {
$this->tpl->assign('ITEM', $item);
$this->tpl->parse('content.item');
}
return true;
}
示例2: processContainers
/**
* process containers
*/
public function processContainers()
{
/**
* check node id value
*/
if (!is_numeric($this->GET['id'])) {
msg("node/default: id not numeric", 'error');
return false;
} else {
$node_id = $this->GET['id'];
}
/**
* initialize
*/
require_once 'models/common/common_node.php';
$Node = new common_node();
$node_data = $Node->nodeDetail($node_id);
//find child nodes
$contentx = $Node->parseChildren($node_id);
//assign to this controller as CONTAINER variable
if (is_array($contentx)) {
foreach ($contentx as $content) {
$container[$content['container']] .= $content['content'];
}
}
/**
* node add icons
* front-end node edit and node move (sort) icons are inserted in controller/node
*
*/
if ($_SESSION['fe_edit_mode'] == 'edit' || $_SESSION['fe_edit_mode'] == 'move') {
//normally we support container.0 to container.6 in default templates, but why not to have some reserve, e.g. 20
$min_container_id = 0;
$max_container_id = 20;
for ($key = $min_container_id; $key < $max_container_id + 1; $key++) {
$container[$key] = "<div class='onxshop_layout_container' id='onxshop_layout_container_{$node_id}_{$key}'>{$container[$key]}</div>";
}
}
$this->tpl->assign("CONTAINER", $container);
$this->tpl->assign("NODE", $node_data);
}