本文整理匯總了PHP中Region::get_all方法的典型用法代碼示例。如果您正苦於以下問題:PHP Region::get_all方法的具體用法?PHP Region::get_all怎麽用?PHP Region::get_all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Region
的用法示例。
在下文中一共展示了Region::get_all方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array_push
array_push($errors, "Invalid slug!");
}
if ($p_slug == '') {
$success = false;
array_push($errors, "The slug field is required !");
}
if ($success) {
$update = array('name' => $p_name, 'slug' => $p_slug);
if ($region['parent'] > 0 && $p_parent > 0) {
$update['parent'] = $p_parent;
}
Region::update($g_id, $update);
$region = Region::get_one($g_id);
}
}
$regions = Region::get_all(array('parent' => 0));
include "page-header.php";
?>
<div id="wrapper">
<?php
include "page-left.php";
?>
<div id="content">
<form name="form_region_edit" id="form_region_edit" method="post" enctype='application/x-www-form-urlencoded' accept-charset="UTF-8" class="form">
<h2><?php
print 'Edit ' . $current_group_page['name'] . ($exists ? "<span class='note'>( id: {$g_id} )</span>" : '');
示例2: array
if (isset($_GET['o'])) {
$o = (int) $_GET['o'];
$r = (int) $_GET['r'];
if ($r != 0) {
$r = 1;
}
Region::set_order($o, $parent, $r);
}
$tct = Region::count(array('parent' => $parent));
//total count
$rpp = 10;
//row per page
$pager_options = array('mode' => 'Sliding', 'perPage' => $rpp, 'delta' => 2, 'totalItems' => $tct, 'urlVar' => "pageID{$parent}", 'excludeVars' => array('o', 'r', 'd', 't', 'e'));
$pager = @Pager::factory($pager_options);
list($from, $to) = $pager->getOffsetByPageId();
$regions = Region::get_all(array('r.parent' => $parent), '', $from - 1 . ", {$rpp}");
include "page-header.php";
?>
<div id="wrapper">
<?php
include "page-left.php";
?>
<div id="content">
<?php
if ($tct > $rpp) {
echo $pager->links . '<br /><br />';
}