本文整理汇总了PHP中Section::get_by_parent_section方法的典型用法代码示例。如果您正苦于以下问题:PHP Section::get_by_parent_section方法的具体用法?PHP Section::get_by_parent_section怎么用?PHP Section::get_by_parent_section使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section::get_by_parent_section方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
?>
parent:
type:section
separator:
type:textbox
default: "|"
style:
type:textarea
<?php
} elseif ($mode == 'layout') {
?>
0
<?php
} elseif ($mode == 'view') {
$sections = new Section();
$sections->order_by('sort', 'asc');
$sections->get_by_parent_section($parent);
function remove_denied($sec)
{
return $sec->can_view();
}
$secs = $sections->all;
$secs = array_filter($secs, 'remove_denied');
$hyperLinks = array();
foreach ($secs as $item) {
$local = site_url($item->id);
array_push($hyperLinks, "<a href=\"{$local}\" style=\"{$style}\" >{$item->name}</a>\n");
}
echo implode($separator, $hyperLinks);
}
示例2: Section
<?php
} else {
if ($mode == 'layout') {
//replace 0 with number of cells your plugin has
?>
0
<?php
} else {
if ($mode == 'view') {
//the real content of your plugin goes here
$sections = new Section();
$sections->order_by('sort', 'asc');
$sections->get_by_parent_section($info->parent);
function remove_denied($sec)
{
return $sec->can_view();
}
$secs = $sections->all;
$secs = array_filter($secs, 'remove_denied');
$hyperLinks = array();
foreach ($secs as $item) {
$local = site_url($item->id);
array_push($hyperLinks, "<a href=\"{$local}\" style=\"{$info->style}\" >{$item->name}</a>");
}
echo implode($info->separator, $hyperLinks);
}
}
}
示例3: array
function rec_section($id, $spacer = '--')
{
$op = array();
$sec = new Section();
$sec->order_by('sort', 'asc');
$sec->get_by_parent_section($id);
foreach ($sec->all as $item) {
$op['s' . $item->id] = $spacer . $item->name;
$op = array_merge($op, rec_section($item->id, $spacer . ' '));
}
return $op;
}
示例4: foreach
$p_sec->get_by_parent_section($info->secondary);
foreach ($p_sec->all as $item) {
?>
<li class="secondary">
<a href="<?php
echo site_url($item->id);
?>
" ><?php
echo $item->name;
?>
</a>
<?php
$sub_section = new Section();
$sub_section->get_by_parent_section($item->id);
if (count($sub_section->all) > 0) {
?>
<ul>
<?php
foreach ($sub_section->all as $sub_item) {
?>
<li>
<a href="<?php
echo site_url($sub_item->id);
?>
"><?php
echo $item->name;
?>
</a>
</li>