当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Paginator::setView方法代码示例

本文整理汇总了PHP中Zend_Paginator::setView方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Paginator::setView方法的具体用法?PHP Zend_Paginator::setView怎么用?PHP Zend_Paginator::setView使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Paginator的用法示例。


在下文中一共展示了Zend_Paginator::setView方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: indexAction

 /**
  * The default action - show the guestbook entries
  */
 public function indexAction()
 {
     $method = __METHOD__;
     $cacheid = str_replace("::", "_", $method) . intval($this->getRequest()->getParam('page', 1));
     $can_edit = false;
     if (Zoo::getService('acl')->checkAccess('edit')) {
         $cacheid .= "_edit";
         $can_edit = true;
     }
     $content = $this->checkCache($cacheid);
     if (!$content) {
         $limit = 20;
         // Offset = items per page multiplied by the page number minus 1
         $offset = ($this->getRequest()->getParam('page', 1) - 1) * $limit;
         $options = array('active' => true, 'nodetype' => 'guestbook_entry', 'order' => 'created DESC', 'render' => true);
         $select = Zoo::getService('content')->getContentSelect($options, $offset, $limit);
         $this->view->items = Zoo::getService('content')->getContent($options, $offset, $limit);
         // Pagination
         Zend_Paginator::setDefaultScrollingStyle('Elastic');
         Zend_View_Helper_PaginationControl::setDefaultViewPartial(array('pagination_control.phtml', 'zoo'));
         $adapter = new Zend_Paginator_Adapter_DbSelect($select);
         $paginator = new Zend_Paginator($adapter);
         $paginator->setItemCountPerPage($limit);
         $paginator->setCurrentPageNumber($this->getRequest()->getParam('page', 1));
         $paginator->setView($this->view);
         $this->view->assign('paginator', $paginator);
         $this->view->can_edit = $can_edit;
         $content = $this->getContent();
         $this->cache($content, $cacheid, array('nodelist', 'guestbook_list'));
     }
     $this->view->pagetitle = Zoo::_('Guestbook');
     $this->renderContent($content);
 }
开发者ID:BGCX261,项目名称:zoocms-svn-to-git,代码行数:36,代码来源:IndexController.php

示例2: listAction

 /**
  * listAction
  * @author Thomas Schedler <tsh@massiveart.com>
  * @version 1.0
  */
 public function listAction()
 {
     $this->core->logger->debug('core->controllers->FolderController->listAction()');
     $strSearchValue = $this->getRequest()->getParam('search');
     $strOrderColumn = $this->getRequest()->getParam('order') != '' ? $this->getRequest()->getParam('order') : '';
     $strOrderSort = $this->getRequest()->getParam('sort') != '' ? $this->getRequest()->getParam('sort') : '';
     $intPortalId = $this->getRequest()->getParam('portalId');
     $intFolderId = $this->getRequest()->getParam('folderId');
     $this->getModelGlobals();
     $objFolderSelect = $this->objModelGlobals->loadFolderContentById($intFolderId, $strSearchValue, $strOrderColumn, $strOrderSort);
     $objAdapter = new Zend_Paginator_Adapter_DbTableSelect($objFolderSelect);
     $objFolderPaginator = new Zend_Paginator($objAdapter);
     $objFolderPaginator->setItemCountPerPage((int) $this->getRequest()->getParam('itemsPerPage', $this->core->sysConfig->list->default->itemsPerPage));
     $objFolderPaginator->setCurrentPageNumber($this->getRequest()->getParam('page'));
     $objFolderPaginator->setView($this->view);
     $this->view->assign('folderPaginator', $objFolderPaginator);
     $this->view->assign('intFolderId', $intFolderId);
     $this->view->assign('strOrderColumn', $strOrderColumn);
     $this->view->assign('strOrderSort', $strOrderSort);
     $this->view->assign('strSearchValue', $strSearchValue);
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:26,代码来源:FolderController.php

示例3: testGetsAndSetsView

 public function testGetsAndSetsView()
 {
     $this->_paginator->setView(new Zend_View());
     $this->assertType('Zend_View_Interface', $this->_paginator->getView());
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:5,代码来源:PaginatorTest.php

示例4: listAction

 /**
  * listAction
  * @author Thomas Schedler <tsh@massiveart.com>
  * @version 1.0
  */
 public function listAction()
 {
     $this->core->logger->debug('users->controllers->ResourceController->listAction()');
     $strOrderColumn = $this->getRequest()->getParam('order') != '' ? $this->getRequest()->getParam('order') : 'title';
     $strSortOrder = $this->getRequest()->getParam('sort') != '' ? $this->getRequest()->getParam('sort') : 'asc';
     $strSearchValue = $this->getRequest()->getParam('search') != '' ? $this->getRequest()->getParam('search') : '';
     $objSelect = $this->getModelUsers()->getResourceTable()->select();
     $objSelect->setIntegrityCheck(false);
     $objSelect->from($this->getModelUsers()->getResourceTable(), array('id', 'title', 'key'));
     $objSelect->joinLeft('users', 'users.id = resources.idUsers', array('CONCAT(`users`.`fname`, \' \', `users`.`sname`) AS editor', 'resources.changed'));
     if ($strSearchValue != '') {
         $objSelect->where('resources.title LIKE ?', '%' . $strSearchValue . '%');
         $objSelect->orWhere('resources.key LIKE ?', '%' . $strSearchValue . '%');
     }
     $objSelect->order($strOrderColumn . ' ' . strtoupper($strSortOrder));
     $objAdapter = new Zend_Paginator_Adapter_DbTableSelect($objSelect);
     $objResourcesPaginator = new Zend_Paginator($objAdapter);
     $objResourcesPaginator->setItemCountPerPage((int) $this->getRequest()->getParam('itemsPerPage', $this->core->sysConfig->list->default->itemsPerPage));
     $objResourcesPaginator->setCurrentPageNumber($this->getRequest()->getParam('page'));
     $objResourcesPaginator->setView($this->view);
     $this->view->assign('resourcePaginator', $objResourcesPaginator);
     $this->view->assign('orderColumn', $strOrderColumn);
     $this->view->assign('sortOrder', $strSortOrder);
     $this->view->assign('searchValue', $strSearchValue);
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:30,代码来源:ResourceController.php

示例5: testGetsAndSetsView

 public function testGetsAndSetsView()
 {
     $this->_paginator->setView(new View\PhpRenderer());
     $this->assertInstanceOf('Zend\\View\\Renderer', $this->_paginator->getView());
 }
开发者ID:rafalwrzeszcz,项目名称:zf2,代码行数:5,代码来源:PaginatorTest.php

示例6: listAction

 /**
  * listAction
  * @author Thomas Schedler <tsh@massiveart.com>
  * @version 1.0
  */
 public function listAction()
 {
     $this->core->logger->debug('properties->controllers->LocationController->listAction()');
     $intUnitId = $this->getRequest()->getParam('folderId', 0);
     $strOrderColumn = $this->getRequest()->getParam('order') != '' ? $this->getRequest()->getParam('order') : 'name';
     $strSortOrder = $this->getRequest()->getParam('sort') != '' ? $this->getRequest()->getParam('sort') : 'asc';
     $strSearchValue = $this->getRequest()->getParam('search') != '' ? $this->getRequest()->getParam('search') : '';
     $objSelect = $this->getModelLocations()->getLocationsTable()->select();
     $objSelect->setIntegrityCheck(false);
     $objSelect->from($this->getModelLocations()->getLocationsTable(), array('id', 'name', 'type' => new Zend_Db_Expr("'location'")));
     $objSelect->joinInner('genericForms', 'genericForms.id = locations.idGenericForms', array('genericForms.genericFormId', 'genericForms.version'));
     $objSelect->joinLeft('users', 'users.id = locations.idUsers', array('CONCAT(`users`.`fname`, \' \', `users`.`sname`) AS editor', 'locations.changed'));
     $objSelect->where('locations.idUnits = ?', $intUnitId);
     if ($strSearchValue != '') {
         $objSelect->where('locations.name LIKE ?', '%' . $strSearchValue . '%');
     }
     $objSelect->order($strOrderColumn . ' ' . strtoupper($strSortOrder));
     $objAdapter = new Zend_Paginator_Adapter_DbTableSelect($objSelect);
     $objGroupsPaginator = new Zend_Paginator($objAdapter);
     $objGroupsPaginator->setItemCountPerPage((int) $this->getRequest()->getParam('itemsPerPage', $this->core->sysConfig->list->default->itemsPerPage));
     $objGroupsPaginator->setCurrentPageNumber($this->getRequest()->getParam('page'));
     $objGroupsPaginator->setView($this->view);
     $this->view->assign('paginator', $objGroupsPaginator);
     $this->view->assign('orderColumn', $strOrderColumn);
     $this->view->assign('sortOrder', $strSortOrder);
     $this->view->assign('searchValue', $strSearchValue);
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:32,代码来源:LocationController.php

示例7: testGetsAndSetsView

 public function testGetsAndSetsView()
 {
     $this->_paginator->setView(new View\View());
     $this->assertType('Zend\\View\\ViewEngine', $this->_paginator->getView());
 }
开发者ID:heiglandreas,项目名称:zf2,代码行数:5,代码来源:PaginatorTest.php

示例8: setView

 /**
  * Set the View object
  *
  * @param  \Zend_View_Interface $view
  * @return \MUtil_Html_PagePanel (continuation pattern)
  */
 public function setView(\Zend_View_Interface $view)
 {
     if ($this->_paginator) {
         $this->_paginator->setView($view);
     }
     return parent::setView($view);
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:13,代码来源:PagePanel.php

示例9: listAction

 /**
  * listAction
  * @author Cornelius Hansjakob <cha@massiveart.com>
  * @version 1.0
  */
 public function listAction()
 {
     $this->core->logger->debug('contacts->controllers->MemberController->listAction()');
     $strOrderColumn = $this->getRequest()->getParam('order') != '' ? $this->getRequest()->getParam('order') : 'sname';
     $strSortOrder = $this->getRequest()->getParam('sort') != '' ? $this->getRequest()->getParam('sort') : 'asc';
     $strSearchValue = $this->getRequest()->getParam('search') != '' ? $this->getRequest()->getParam('search') : '';
     $objSelect = $this->getModelMembers()->getMembersTable()->select();
     $objSelect->setIntegrityCheck(false);
     $objSelect->from($this->getModelMembers()->getMembersTable(), array('id', 'fname', 'sname', 'company' => 'companies.name', 'username', 'status' => 'contactStatus.title', 'type' => new Zend_Db_Expr("'member'")));
     $objSelect->joinInner('genericForms', 'genericForms.id = members.idGenericForms', array('genericForms.genericFormId', 'genericForms.version'));
     $objSelect->joinLeft('users', 'users.id = members.idUsers', array('members.changed'));
     $objSelect->joinLeft('companies', 'companies.id = members.company', array());
     $objSelect->joinLeft('contactStatus', 'contactStatus.id = members.status', array());
     $objSelect->where('members.idRootLevels = ?', $this->getRequest()->getParam('rootLevelId'));
     if ($strSearchValue != '') {
         $objSelect->where('members.fname LIKE ?', '%' . $strSearchValue . '%');
         $objSelect->orWhere('members.sname LIKE ?', '%' . $strSearchValue . '%');
         $objSelect->orWhere('companies.name LIKE ?', '%' . $strSearchValue . '%');
         $objSelect->orWhere('contactStatus.title = ?', $strSearchValue);
     }
     $objSelect->order($strOrderColumn . ' ' . strtoupper($strSortOrder));
     $objAdapter = new Zend_Paginator_Adapter_DbTableSelect($objSelect);
     $objGroupsPaginator = new Zend_Paginator($objAdapter);
     $objGroupsPaginator->setItemCountPerPage((int) $this->getRequest()->getParam('itemsPerPage', $this->core->sysConfig->list->default->itemsPerPage));
     $objGroupsPaginator->setCurrentPageNumber($this->getRequest()->getParam('page'));
     $objGroupsPaginator->setView($this->view);
     $this->view->assign('paginator', $objGroupsPaginator);
     $this->view->assign('orderColumn', $strOrderColumn);
     $this->view->assign('sortOrder', $strSortOrder);
     $this->view->assign('searchValue', $strSearchValue);
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:36,代码来源:MemberController.php

示例10: listAction

 /**
  * listAction
  * @author Thomas Schedler <tsh@massiveart.com>
  * @version 1.0
  */
 public function listAction()
 {
     $this->core->logger->debug('global->controllers->ElementController->listAction()');
     $strOrderColumn = $this->getRequest()->getParam('order') != '' ? $this->getRequest()->getParam('order') : 'title';
     $strSortOrder = $this->getRequest()->getParam('sort') != '' ? $this->getRequest()->getParam('sort') : 'asc';
     $strSearchValue = $this->getRequest()->getParam('search') != '' ? $this->getRequest()->getParam('search') : '';
     $objSelect = $this->getModelGlobals()->getGlobalTable()->select();
     $objSelect->setIntegrityCheck(false);
     $objSelect->from($this->getModelGlobals()->getGlobalTable(), array('id'))->joinInner('globalProperties', 'globalProperties.globalId = globals.globalId AND globalProperties.version = globals.version AND globalProperties.idLanguages = ' . $this->core->dbh->quote(Zend_Auth::getInstance()->getIdentity()->languageId, Zend_Db::INT_TYPE), array())->joinInner('globalTitles', 'globalTitles.globalId = globals.globalId AND globalTitles.version = globals.version AND globalProperties.idLanguages = ' . $this->core->dbh->quote(Zend_Auth::getInstance()->getIdentity()->languageId, Zend_Db::INT_TYPE), array('title'))->joinLeft(array('editor' => 'users'), 'editor.id = globalProperties.idUsers', array('editor' => 'CONCAT(`editor`.`fname`, \' \', `editor`.`sname`)', 'globalProperties.changed'))->where('idParent = ?', $this->getRequest()->getParam('rootLevelId'))->where('idParentTypes = ?', $this->core->sysConfig->parent_types->rootlevel)->where('isStartGlobal = 0')->where('globalTitles.idLanguages = ?', Zend_Auth::getInstance()->getIdentity()->languageId);
     if ($strSearchValue != '') {
         $objSelect->where('globalTitles.title LIKE ?', '%' . $strSearchValue . '%');
     }
     $objSelect->order($strOrderColumn . ' ' . strtoupper($strSortOrder));
     $objAdapter = new Zend_Paginator_Adapter_DbTableSelect($objSelect);
     $objGlobalsPaginator = new Zend_Paginator($objAdapter);
     $objGlobalsPaginator->setItemCountPerPage((int) $this->getRequest()->getParam('itemsPerPage', $this->core->sysConfig->list->default->itemsPerPage));
     $objGlobalsPaginator->setCurrentPageNumber($this->getRequest()->getParam('page'));
     $objGlobalsPaginator->setView($this->view);
     $this->view->assign('paginator', $objGlobalsPaginator);
     $this->view->assign('orderColumn', $strOrderColumn);
     $this->view->assign('sortOrder', $strSortOrder);
     $this->view->assign('searchValue', $strSearchValue);
     $this->getModelFolders();
     $objRootLevels = $this->objModelFolders->loadAllRootLevels($this->core->sysConfig->modules->global);
     $this->view->assign('rootLevels', $objRootLevels);
     $this->view->assign('folderFormDefaultId', $this->core->sysConfig->form->ids->folders->default);
     $this->view->assign('elementFormDefaultId', $this->core->sysConfig->global_types->product->default_formId);
     $this->view->assign('elementTemplateDefaultId', $this->core->sysConfig->global_types->product->default_templateId);
     $this->view->assign('elementTypeDefaultId', $this->core->sysConfig->global_types->product->id);
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:35,代码来源:ElementController.php

示例11: businessAction

 /**
  * Job basic for seo.
  * show all the jobs in the city.
  * @return unknown_type
  */
 function businessAction()
 {
     //echo   "jobs";
     $this->view = $this->_setRequiredParamsToView($this->view);
     $this->view->category = $this->_busType;
     try {
         $this->view->business = $this->getBusiness();
         $this->view->form = $this->getForm($this->view->business, $this->view->location);
         //$values['cat4'] = Location::getStateIdByName($this->view->location->getState());
         //	$values['cat5'] = Location::getCityIdByName($this->view->location->getCity());
         $cat1 = $this->view->paramsHolder->cat1;
         $additonalData = $this->_getAdditionalData($this->view);
         $select = $this->view->business->search($this->view->location, $this->view->limit, $this->view->offset, $this->view->paramsHolder->query, $cat1, $this->view->paramsHolder->cat2, $this->view->paramsHolder->cat3, $this->view->paramsHolder->cat4, $this->view->paramsHolder->cat5, $additonalData);
         if (!empty($select)) {
             logfire('------select: ', $select->__toString());
             $adapter = new Zend_Paginator_Adapter_DbTableSelect($select);
             $paginator = new Zend_Paginator($adapter);
             $paginator->setItemCountPerPage($this->view->limit);
             $paginator->setCurrentPageNumber($this->view->offset);
             Zend_Paginator::setDefaultScrollingStyle('Sliding');
             Zend_View_Helper_PaginationControl::setDefaultViewPartial('sitetemplate/_pagination.phtml');
             $this->view->currentItemCount = $paginator->getCurrentItemCount();
             $this->view->itemCount = $paginator->getTotalItemCount();
             //echo '------currentItemCoutn: ' .  $this->view->currentItemCount;
             $paginator->setView($this->view);
             $this->view->postings = $paginator;
             /*
             foreach($this->view->postings as $key=>$value)
             {
             print_r($value);break;
             }
             */
         }
     } catch (Exception $e) {
         echo $e;
     }
     //$this->renderScript('jobs/index.phtml');
     //  	echo Tag::link('jobsbasic',$this->view->location->toStdClass(),'test');
 }
开发者ID:xinghao,项目名称:shs,代码行数:44,代码来源:BusinessController.php

示例12: listAction

 /**
  * listAction
  * @author Cornelius Hansjakob <cha@massiveart.com>
  * @version 1.0
  */
 public function listAction()
 {
     $this->core->logger->debug('media->controllers->ViewController->listAction()');
     $strSearchValue = $this->getRequest()->getParam('search');
     $strOrderColumn = $this->getRequest()->getParam('order') != '' ? $this->getRequest()->getParam('order') : '';
     $strOrderSort = $this->getRequest()->getParam('sort') != '' ? $this->getRequest()->getParam('sort') : '';
     $objRequest = $this->getRequest();
     $intFolderId = $objRequest->getParam('folderId');
     /**
      * get files
      */
     $this->getModelFiles();
     $objFilesSelect = $this->objModelFiles->loadFiles($intFolderId, -1, false, true, $strSearchValue, $strOrderColumn, $strOrderSort);
     $objAdapter = new Zend_Paginator_Adapter_DbTableSelect($objFilesSelect);
     $objFilePaginator = new Zend_Paginator($objAdapter);
     $objFilePaginator->setItemCountPerPage((int) $this->getRequest()->getParam('itemsPerPage', $this->core->sysConfig->list->default->itemsPerPage));
     $objFilePaginator->setCurrentPageNumber($this->getRequest()->getParam('page'));
     $objFilePaginator->setView($this->view);
     $this->view->assign('filePaginator', $objFilePaginator);
     $this->view->assign('intFolderId', $intFolderId);
     $this->view->assign('strOrderColumn', $strOrderColumn);
     $this->view->assign('strOrderSort', $strOrderSort);
     $this->view->assign('strSearchValue', $strSearchValue);
     $this->assignSecurityOptions();
 }
开发者ID:BGCX261,项目名称:zoolu-svn-to-git,代码行数:30,代码来源:ViewController.php

示例13: testGetsAndSetsView

 public function testGetsAndSetsView()
 {
     $this->_paginator->setView(new Zend_View());
     $this->assertTrue($this->_paginator->getView() instanceof Zend_View_Interface);
 }
开发者ID:crodriguezn,项目名称:crossfit-milagro,代码行数:5,代码来源:PaginatorTest.php

示例14: listAction

 /**
  * List files in a category
  */
 public function listAction()
 {
     $found = Zoo::getService('content')->find($this->_request->getParam('id'));
     if ($found->count() == 0) {
         throw new Zend_Controller_Action_Exception(Zoo::_("Category does not exist"), 404);
     }
     $category = $found->current();
     $this->view->assign('category', $category);
     $limit = $this->getRequest()->getParam('limit', 20);
     // Offset = items per page multiplied by the page number minus 1
     $offset = ($this->getRequest()->getParam('page', 1) - 1) * $limit;
     $order = $this->getRequest()->getParam('order', "created DESC");
     $nodetype = $this->getRequest()->getParam('nodetype', "filemanager_file");
     $options = array('active' => true, 'nodetype' => $nodetype, 'parent' => $category->id, 'order' => $order, 'render' => false);
     $select = Zoo::getService('content')->getContentSelect($options, $offset, $limit);
     $this->view->items = Zoo::getService('content')->getContent($options, $offset, $limit);
     // Pagination
     Zend_Paginator::setDefaultScrollingStyle('Elastic');
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('file/pagination_control.phtml');
     $adapter = new Zend_Paginator_Adapter_DbSelect($select);
     $paginator = new Zend_Paginator($adapter);
     $paginator->setItemCountPerPage($limit);
     $paginator->setCurrentPageNumber($this->getRequest()->getParam('page', 1));
     $paginator->setView($this->view);
     $this->view->assign('paginator', $paginator);
 }
开发者ID:BGCX261,项目名称:zoocms-svn-to-git,代码行数:29,代码来源:FileController.php

示例15: testGetSetView

 public function testGetSetView()
 {
     $this->_restorePaginatorDefaults();
     $this->_paginator->setView(new Zend_View());
     $this->assertType('Zend_View_Interface', $this->_paginator->getView());
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:6,代码来源:PaginatorTest.php


注:本文中的Zend_Paginator::setView方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。