本文整理汇总了PHP中Paginator::query方法的典型用法代码示例。如果您正苦于以下问题:PHP Paginator::query方法的具体用法?PHP Paginator::query怎么用?PHP Paginator::query使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Paginator
的用法示例。
在下文中一共展示了Paginator::query方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hook_callback
public function hook_callback($content, $orm)
{
$request = $this->request;
$back_url = $request->url();
$query_array = $request->query();
if (!empty($query_array)) {
$back_url .= '?' . http_build_query($query_array);
}
$back_url .= '#tab-' . $this->tab_code;
unset($query_array);
$query_array = array('group' => $this->blog_group, 'blog' => $orm->blog_id, 'back_url' => $back_url, 'content_only' => TRUE);
$query_array = Paginator::query($request, $query_array);
$link = Route::url('modules', array('controller' => $this->controller_name, 'query' => Helper_Page::make_query_string($query_array)));
$html_blog = Request::factory($link)->execute()->body();
$tab_nav_html = View_Admin::factory('layout/tab/nav', array('code' => $this->tab_code, 'title' => '<b>' . __('Blog') . '</b>'));
$tab_pane_html = View_Admin::factory('layout/tab/pane', array('code' => $this->tab_code, 'content' => $html_blog));
return str_replace(array('<!-- #tab-nav-insert# -->', '<!-- #tab-pane-insert# -->'), array($tab_nav_html . '<!-- #tab-nav-insert# -->', $tab_pane_html . '<!-- #tab-pane-insert# -->'), $content);
}
示例2: action_view
public function action_view()
{
$request = $this->request->current();
$id = (int) $request->param('id');
$helper_orm = ORM_Helper::factory('video');
$orm = $helper_orm->orm();
$orm->where('id', '=', $id)->find();
if (!$orm->loaded()) {
throw new HTTP_Exception_404();
}
if (empty($this->back_url)) {
$query_array = Paginator::query($request);
$this->back_url = Route::url('modules', array('controller' => $this->controller_name['element'], 'query' => Helper_Page::make_query_string($query_array)));
}
$this->template->set_filename('modules/video/element/view')->set('helper_orm', $helper_orm);
$this->title = __('Viewing');
$this->left_menu_element_add();
}
示例3: action_visibility
public function action_visibility()
{
$request = $this->request->current();
$id = (int) $request->param('id');
$mode = $request->query('mode');
$orm = ORM::factory('news_Category')->where('page_id', '=', $this->module_page_id)->and_where('id', '=', $id)->find();
if (!$orm->loaded() or !$this->acl->is_allowed($this->user, $orm, 'hide')) {
throw new HTTP_Exception_404();
}
if (in_array($orm->code, $this->not_deleted_categories)) {
throw new HTTP_Exception_404();
}
if ($mode == 'hide') {
$this->element_hide($orm->object_name(), $orm->id);
} elseif ($mode == 'show') {
$this->element_show($orm->object_name(), $orm->id);
}
if (empty($this->back_url)) {
$query_array = array('page' => $this->module_page_id);
$query_array = Paginator::query($request, $query_array);
$this->back_url = Route::url('modules', array('controller' => $this->controller_name['category'], 'query' => Helper_Page::make_query_string($query_array)));
}
$request->redirect($this->back_url);
}
示例4: defined
<?php
defined('SYSPATH') or die('No direct access allowed.');
echo View_Admin::factory('layout/breadcrumbs', array('breadcrumbs' => $breadcrumbs));
$orm = $helper_orm->orm();
$labels = $orm->labels();
$required = $orm->required_fields();
$query_array = array('group' => $GROUP_KEY, 'blog' => $BLOG_ID);
if (!empty($BACK_URL)) {
$query_array['back_url'] = $BACK_URL;
}
if ($orm->loaded()) {
$query_array = Paginator::query(Request::current(), $query_array);
$action = Route::url('modules', array('controller' => $CONTROLLER_NAME['element'], 'action' => 'edit', 'id' => $orm->id, 'query' => Helper_Page::make_query_string($query_array)));
$_link = Route::url('preview', array('directory' => 'modules', 'controller' => 'blog', 'query' => Helper_Page::make_query_string(array('id' => $orm->id, 'token' => Route::get_preview_token($orm->id)))), NULL, $SITE['code']);
$preview_link = HTML::anchor($_link, __('Preview link'), array('class' => 'item-preview-link', 'target' => '_blank'));
} else {
$action = Route::url('modules', array('controller' => $CONTROLLER_NAME['element'], 'action' => 'edit', 'query' => Helper_Page::make_query_string($query_array)));
$preview_link = '';
}
echo View_Admin::factory('layout/error')->bind('errors', $errors);
?>
<form method="post" action="<?php
echo $action;
?>
" enctype="multipart/form-data" class="form-horizontal" >
<div class="tabbable">
<ul class="nav nav-tabs kr-nav-tsbs">
<?php
echo '<li class="active">', HTML::anchor('#tab-main', __('Main'), array('data-toggle' => 'tab')), '</li>';
示例5: action_delete
public function action_delete()
{
$request = $this->request->current();
$id = (int) $request->param('id');
$helper_orm = ORM_Helper::factory('site', $id);
$orm = $helper_orm->orm();
if (!$orm->loaded() or !$this->acl->is_allowed($this->user, $orm, 'edit')) {
throw new HTTP_Exception_404();
}
if ($this->element_delete($helper_orm)) {
if (empty($this->back_url)) {
$query_array = Paginator::query($request);
$this->back_url = Route::url('admin', array('controller' => 'sites', 'query' => Helper_Page::make_query_string($query_array)));
}
$request->redirect($this->back_url);
}
}
示例6: action_position
public function action_position()
{
$album_orm = ORM::factory('photo_Album')->where('group', '=', $this->group_key)->and_where('id', '=', $this->album_id)->find();
if (!$album_orm->loaded()) {
throw new HTTP_Exception_404();
}
$request = $this->request->current();
$id = (int) $request->param('id');
$mode = $request->query('mode');
$errors = array();
$helper_orm = ORM_Helper::factory('photo');
try {
$this->element_position($helper_orm, $id, $mode);
} catch (ORM_Validation_Exception $e) {
$errors = $this->errors_extract($e);
}
if (empty($errors)) {
if (empty($this->back_url)) {
$query_array = array('group' => $this->group_key, 'album' => $this->album_id);
if ($mode != 'fix') {
$query_array = Paginator::query($request, $query_array);
}
$this->back_url = Route::url('modules', array('controller' => $this->controller_name['element'], 'query' => Helper_Page::make_query_string($query_array)));
}
$request->redirect($this->back_url);
}
}
示例7: action_mark
public function action_mark()
{
$request = $this->request->current();
$id = (int) Request::current()->param('id');
$orm = ORM::factory('form_Response', $id);
if (!$orm->loaded()) {
throw new HTTP_Exception_404();
}
$orm_form = $orm->form;
if (!$orm_form->loaded()) {
throw new HTTP_Exception_404();
}
if (empty($this->back_url)) {
$query_array = array('owner' => $this->owner);
$query_array = Paginator::query($request, $query_array);
$this->back_url = Route::url('admin', array('controller' => $this->controller_name['responses'], 'action' => 'form', 'id' => $orm_form->id, 'query' => Helper_Page::make_query_string($query_array)));
}
try {
$orm->new = 0;
$orm->save();
} catch (ORM_Validation_Exception $e) {
}
$request->redirect($this->back_url);
}
示例8: action_delete
public function action_delete()
{
$request = $this->request->current();
$id = (int) $request->param('id');
$helper_orm = ORM_Helper::factory('form');
$orm = $helper_orm->orm();
$orm->and_where('id', '=', $id)->find();
if (!$orm->loaded() or !$this->acl->is_allowed($this->user, $orm, 'edit')) {
throw new HTTP_Exception_404();
}
if (in_array($orm->owner, $this->not_deleted_owner)) {
throw new HTTP_Exception_404();
}
if ($this->element_delete($helper_orm)) {
if (empty($this->back_url)) {
$query_array = array('owner' => $this->owner);
$query_array = Paginator::query($request, $query_array);
$this->back_url = Route::url('modules', array('controller' => $this->controller_name['structure'], 'query' => Helper_Page::make_query_string($query_array)));
}
$request->redirect($this->back_url);
}
}