本文整理汇总了PHP中fURL::replaceInQueryString方法的典型用法代码示例。如果您正苦于以下问题:PHP fURL::replaceInQueryString方法的具体用法?PHP fURL::replaceInQueryString怎么用?PHP fURL::replaceInQueryString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fURL
的用法示例。
在下文中一共展示了fURL::replaceInQueryString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fNoRowsException
try {
if (method_exists($results, 'tossIfNoRows')) {
$results->tossIfNoRows();
} else {
throw new fNoRowsException();
}
?>
<?php
//check to see if paging is needed
$total_pages = ceil($alert_count / $GLOBALS['PAGE_SIZE']);
if ($total_pages > 1) {
$prev_class = 'previous';
$prev_link = fURL::replaceInQueryString('page', $page_num - 1);
$next_class = 'next';
$next_link = fURL::replaceInQueryString('page', $page_num + 1);
if ($page_num == 1) {
$prev_class .= ' disabled';
$prev_link = '#';
} elseif ($page_num == $total_pages) {
$next_class .= ' disabled';
$next_link = '#';
}
?>
</tbody></table>
<div class="pagination">
<ul class="pager">
<li class="<?php
echo $prev_class;
?>
">
示例2: showTemplatedLinks
/**
* Prints the links for a set of records
*
* @param string $template The template to use
* @param array $data The extra data to make available to the template
* @param integer $page The page of records being displayed
* @param integer $per_page The number of records being displayed on each page
* @param integer $total_records The total number of records
* @return void
*/
private static function showTemplatedLinks($template, $data, $page, $per_page, $total_records)
{
if ($total_records <= $per_page) {
return FALSE;
}
$total_pages = ceil($total_records / $per_page);
self::printPiece($template, 'start', array_merge(array('page' => $page, 'total_pages' => $total_pages, 'first_record' => ($page - 1) * $per_page + 1, 'last_record' => min($page * $per_page, $total_records), 'total_records' => $total_records), $data));
if ($page > 1) {
self::printPiece($template, 'prev', array_merge(array('page' => $page - 1, 'url' => fURL::replaceInQueryString('page', $page - 1)), $data));
} else {
self::printPiece($template, 'prev_disabled', $data);
}
$size = self::$templates[$template]['size'];
if (self::$templates[$template]['type'] == 'without_first_last') {
$start_page = max(1, $page - $size);
$end_page = min($total_pages, $page + $size);
} else {
$start_separator = TRUE;
$start_page = $page - ($size - 2);
if ($start_page <= 2) {
$start_separator = FALSE;
$start_page = 1;
}
$extra_end_pages = 0;
if ($page <= $size) {
$extra_end_pages = $size - $page + 1;
}
$end_separator = TRUE;
$end_page = $page + ($size - 2);
if ($end_page >= $total_pages - 1) {
$end_separator = FALSE;
$end_page = $total_pages;
}
$extra_start_pages = 0;
if ($page > $total_pages - $size) {
$extra_start_pages = $size - ($total_pages - $page);
}
$start_page -= $extra_start_pages;
if ($start_page <= 3) {
$start_separator = FALSE;
$start_page = 1;
}
$end_page += $extra_end_pages;
if ($end_page >= $total_pages - 2) {
$end_separator = FALSE;
$end_page = $total_pages;
}
}
if (self::$templates[$template]['type'] == 'with_first_last' && $start_separator) {
self::printPiece($template, 'page', array_merge(array('page' => 1, 'url' => fURL::replaceInQueryString('page', 1), 'first' => 'first', 'last' => '', 'current' => ''), $data));
self::printPiece($template, 'separator', $data);
}
for ($loop_page = $start_page; $loop_page <= $end_page; $loop_page++) {
self::printPiece($template, 'page', array_merge(array('page' => $loop_page, 'url' => fURL::replaceInQueryString('page', $loop_page), 'first' => $loop_page == 1 ? 'first' : '', 'last' => $loop_page == $total_pages ? 'last' : '', 'current' => $loop_page == $page ? 'current' : ''), $data));
}
if (self::$templates[$template]['type'] == 'with_first_last' && $end_separator) {
self::printPiece($template, 'separator', $data);
self::printPiece($template, 'page', array_merge(array('page' => $total_pages, 'url' => fURL::replaceInQueryString('page', $total_pages), 'first' => '', 'last' => 'last', 'current' => ''), $data));
}
if ($page < $total_pages) {
self::printPiece($template, 'next', array_merge(array('page' => $page + 1, 'url' => fURL::replaceInQueryString('page', $page + 1)), $data));
} else {
self::printPiece($template, 'next_disabled', $data);
}
self::printPiece($template, 'end', array_merge(array('page' => $page, 'total_pages' => $total_pages, 'first_record' => ($page - 1) * $per_page + 1, 'last_record' => min($page * $per_page, $total_records), 'total_records' => $total_records), $data));
return TRUE;
}
示例3: redirectWithLoadedValues
/**
* Checks to see if any values (search or sort) were loaded from the session, and if so redirects the user to the current URL with those values added
*
* @return void
*/
public static function redirectWithLoadedValues()
{
// If values were reset, redirect to the plain URL
if (self::wasResetRequested()) {
fURL::redirect(fURL::get() . fURL::removeFromQueryString('reset'));
}
$query_string = fURL::replaceInQueryString(array_keys(self::$loaded_values), array_values(self::$loaded_values));
$url = fURL::get() . $query_string;
if ($url != fURL::getWithQueryString() && $url != fURL::getWithQueryString() . '?') {
fURL::redirect($url);
}
}
示例4: foreach
</div>
</div>
</div>
<div id="links" class="<?php
echo $display_options_links > 1 ? 'dashboardslinks' : '';
?>
popover fade bottom in" style="display:none;">
<div class="arrow"></div>
<div class="popover-content">
<h4>Dashboard(s) in group :</h4>
<ul>
<?php
foreach ($other_dashboards_in_group as $dashboard_in_group) {
?>
<li><a href="<?php
echo fURL::replaceInQueryString('dashboard_id', $dashboard_in_group->getDashboardId());
?>
"><?php
echo $dashboard_in_group->getName();
?>
</a></li>
<?php
}
?>
</ul>
</div>
</div>
<div id="graphscontainer">
<center> <!-- cssblasphemy but i need it look decent real quick -->
<h1>