本文整理匯總了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);
}