本文整理汇总了PHP中Section::populate方法的典型用法代码示例。如果您正苦于以下问题:PHP Section::populate方法的具体用法?PHP Section::populate怎么用?PHP Section::populate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Section
的用法示例。
在下文中一共展示了Section::populate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_sections
function get_sections($con, $args)
{
$sections = array();
if (isset($args["section_id"])) {
$section_id = $args["section_id"];
$sql = $con->prepare("SELECT section_name,tid,`order` FROM section WHERE section_id=?");
$sql->bind_param("i", $section_id);
$sql->bind_result($section_name, $tid, $order);
$sql->execute();
$sql->fetch();
$sql->close();
if (isset($section_name) && isset($tid) && isset($order)) {
$tmp = new Section();
$tmp->populate($section_id, $tid, $section_name, [], $order);
$sections[] = $tmp->expose();
}
} else {
if (isset($args["section_name"])) {
$section_name = $args["section_name"];
$sql = $con->prepare("SELECT section_id,tid,`order` FROM section WHERE section_name=?");
$sql->bind_param("s", $section_name);
$sql->bind_result($section_id, $tid, $order);
$sql->execute();
while ($sql->fetch()) {
if (isset($section_id) && isset($tid) && isset($order)) {
$tmp = new Section();
$tmp->populate($section_id, $tid, $section_name, [], $order);
$sections[] = $tmp->expose();
}
}
$sql->close();
} else {
$sql = $con->prepare("SELECT section_id,tid,section_name,`order` FROM section");
$sql->bind_result($section_id, $tid, $section_name, $order);
$sql->execute();
while ($sql->fetch()) {
if (isset($section_id) && isset($tid) && isset($section_name) && isset($order)) {
$tmp = new Section();
$tmp->populate($section_id, $tid, $section_name, [], $order);
$section = $tmp->expose();
$sections[] = $section;
}
}
$sql->close();
}
}
return $sections;
}
示例2: Right
} else {
$description = "Ajout d'un rang";
$button = "Ajouter";
}
$tpl->assign('description', $description);
$tpl->assign('button', $button);
$tpl->assign('ranks', $ranks);
break;
case 'right':
$rightManager = new Right();
$sectionManager = new Section();
$rank = new Rank();
$rank = $rank->getById($_['id']);
$rights = $rightManager->loadAll(array('rank' => $_['id']));
$rightsDictionnary = array();
foreach ($rights as $value) {
$rightsDictionnary[$value->getSection()]['c'] = $value->getCreate();
$rightsDictionnary[$value->getSection()]['r'] = $value->getRead();
$rightsDictionnary[$value->getSection()]['u'] = $value->getUpdate();
$rightsDictionnary[$value->getSection()]['d'] = $value->getDelete();
}
$tpl->assign('rights', $rightsDictionnary);
$tpl->assign('sections', $sectionManager->populate('label'));
$tpl->assign('rank', $rank);
break;
}
$view = 'setting';
} else {
exit('Vous devez être connecté');
}
require_once dirname(__FILE__) . '/footer.php';