當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Paginator::query方法代碼示例

本文整理匯總了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);
 }
開發者ID:greor,項目名稱:kohana-blog,代碼行數:18,代碼來源:blog.php

示例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();
 }
開發者ID:greor,項目名稱:kohana-video,代碼行數:18,代碼來源:element.php

示例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);
 }
開發者ID:greor,項目名稱:kohana-news,代碼行數:24,代碼來源:category.php

示例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>';
開發者ID:greor,項目名稱:kohana-blog,代碼行數:31,代碼來源:edit.php

示例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);
     }
 }
開發者ID:greor,項目名稱:satin-spb,代碼行數:17,代碼來源:sites.php

示例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);
     }
 }
開發者ID:greor,項目名稱:kohana-photo,代碼行數:27,代碼來源:element.php

示例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);
 }
開發者ID:greor,項目名稱:satin-spb,代碼行數:24,代碼來源:responses.php

示例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);
     }
 }
開發者ID:greor,項目名稱:satin-spb,代碼行數:22,代碼來源:structure.php


注:本文中的Paginator::query方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。