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


PHP Zend_Paginator::setDefaultItemCountPerPage方法代码示例

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


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

示例1: _initStatics

 /**
  *
  * Kilka dodatkowych statycznych inicjaliacji
  *
  */
 public function _initStatics()
 {
     $config = $this->getApplication()->getOptions();
     /**
      * Ustawienie konfigu na rejestrze dla kompatybilnosci z poprzednmi rozwiazaniami (resouce plugin dla ACL)
      */
     Zend_Registry::set('config', $config);
     if (isset($config['general']['pluginloader']) and $config['general']['pluginloader']) {
         $classFileIncCache = APPLICATION_PATH . '/../tmp/pluginLoaderCache.php';
         if (file_exists($classFileIncCache)) {
             include_once $classFileIncCache;
         }
         Zend_Loader_PluginLoader::setIncludeFileCache($classFileIncCache);
     }
     /**
      * Ustawienie fallback tak by klasy bez namespacu tez dzialaly
      */
     Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true)->pushAutoloader(NULL, 'Smarty_');
     /**
      * Domyslny rozmiar strony paginatora
      */
     Zend_Paginator::setDefaultItemCountPerPage($config['paginator']['DefaultItemCountPerPage']);
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('/common/paginator_footer.phtml');
     Zend_Controller_Action_HelperBroker::addPrefix('Base_Controller_Action_Helper');
     Zend_Markup::addRendererPath('Logic', 'Logic/');
     Base_Logic_Abstract::setUsePreexecuteHooks($config['general']['usepreexecutehooks']);
 }
开发者ID:knatorski,项目名称:SMS,代码行数:32,代码来源:Bootstrap.php

示例2: _initPaginator

 protected function _initPaginator()
 {
     $options = $this->getOptions();
     if (array_key_exists('cache', $options) && $options['cache']) {
         // ensure the cache is initialized...
         $this->getBootstrap()->bootstrap('cachemanager');
         // get the cache manager object
         $manager = $this->getBootstrap()->getResource('cachemanager');
         // get the paginator cache object
         $cache = $manager->getCache(self::PAGINATOR_CACHE);
         if (!is_null($cache)) {
             Zend_Paginator::setCache($cache);
         }
     }
     if (!empty($options['scrollingType'])) {
         Zend_Paginator::setDefaultScrollingStyle($options['scrollingType']);
     } else {
         Zend_Paginator::setDefaultScrollingStyle(self::DEFAULT_SCROLLING_TYPE);
     }
     if (!empty($options['recordsPerPage'])) {
         Zend_Paginator::setDefaultItemCountPerPage($options['recordsPerPage']);
     } else {
         Zend_Paginator::setDefaultItemCountPerPage(self::DEFAULT_RECORDS_PER_PAGE);
     }
     if (!empty($options['viewScript'])) {
         Zend_View_Helper_PaginationControl::setDefaultViewPartial($options['viewScript']);
     }
 }
开发者ID:rawatanil3,项目名称:Zend-Framework-Development-Project,代码行数:28,代码来源:Paginator.php

示例3: _initPaginator

 /**
  * 初始化Zend_Paginator
  */
 protected function _initPaginator()
 {
     Zend_Paginator::setDefaultItemCountPerPage(15);
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginator.phtml');
     $view = $this->bootstrap('view')->getResource('view');
     $view->addScriptPath(realpath(__DIR__) . '/layouts');
 }
开发者ID:starflash,项目名称:ZtChart-ZF1-Example,代码行数:10,代码来源:Bootstrap.php

示例4: __construct

 /**
  * Constructor.
  *
  * @param Doctrine_Query $select The select query
  */
 public function __construct(Doctrine_Query $select)
 {
     $this->_select = $select;
     // Set default paginator options
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_Paginator::setDefaultItemCountPerPage(8);
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
 }
开发者ID:valentinbora,项目名称:gasestema,代码行数:13,代码来源:Adapter.php

示例5: __construct

    public function __construct() {
        $this->bootstrap = new Zend_Application(APPLICATION_ENV, APPLICATION_PATH . '/configs/application.ini' );

        Zend_Registry::set('config', $this->bootstrap->getOptions());
        $config = Zend_Registry::get('config');

        Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);
        //Zend_Loader::loadClass('Base_Controller_Action_Helper_Messenger_Abstract');
        Zend_Paginator::setDefaultItemCountPerPage($config['paginator']['DefaultItemCountPerPage']);
        Zend_Validate::addDefaultNamespaces('Base_Form_Validate');
    }
开发者ID:knatorski,项目名称:SMS,代码行数:11,代码来源:MainControllerTestCase.php

示例6: _createGridData

 /**
  * Create the grid data structure
  * 
  * @return object
  */
 protected function _createGridData(Zend_Controller_Request_Abstract $request)
 {
     // Instantiate Zend_Paginator with the required data source adaptor
     if (!$this->_paginator instanceof Zend_Paginator) {
         $this->_paginator = new Zend_Paginator($this->_adapter);
         $this->_paginator->setDefaultItemCountPerPage($request->getParam('rows', $this->_defaultItemCountPerPage));
     }
     // Filter items by supplied search criteria
     if ($request->getParam('_search') == 'true') {
         $filter = $this->_getFilterParams($request);
         $this->_paginator->getAdapter()->filter($filter['field'], $filter['value'], $filter['expression'], $filter['options']);
     }
     // Sort items by the supplied column field
     if ($request->getParam('sidx')) {
         $this->_paginator->getAdapter()->sort($request->getParam('sidx'), $request->getParam('sord', 'asc'));
     }
     // Pass the current page number to paginator
     $this->_paginator->setCurrentPageNumber($request->getParam('page', 1));
     // Fetch a row of items from the adapter
     $rows = $this->_paginator->getCurrentItems();
     $grid = new stdClass();
     $grid->page = $this->_paginator->getCurrentPageNumber();
     $grid->total = $this->_paginator->getItemCountPerPage();
     $grid->records = $this->_paginator->getTotalItemCount();
     $grid->rows = array();
     foreach ($rows as $k => $row) {
         if (isset($row['id'])) {
             $grid->rows[$k]['id'] = $row['id'];
         }
         $grid->rows[$k]['cell'] = array();
         foreach ($this->_columns as $column) {
             array_push($grid->rows[$k]['cell'], $column->cellValue($row));
         }
     }
     return $grid;
 }
开发者ID:josmel,项目名称:adminwap,代码行数:41,代码来源:JqGrid.php

示例7: testGetSetDefaultItemCountPerPage

 /**
  * @group ZF-5785
  */
 public function testGetSetDefaultItemCountPerPage()
 {
     Zend_Paginator::setConfig(new Zend_Config(array()));
     $paginator = Zend_Paginator::factory(range(1, 10));
     $this->assertEquals(10, $paginator->getItemCountPerPage());
     Zend_Paginator::setDefaultItemCountPerPage(20);
     $this->assertEquals(20, Zend_Paginator::getDefaultItemCountPerPage());
     $paginator = Zend_Paginator::factory(range(1, 10));
     $this->assertEquals(20, $paginator->getItemCountPerPage());
     $this->_restorePaginatorDefaults();
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:14,代码来源:PaginatorTest.php

示例8: _initPaginator

 protected function _initPaginator()
 {
     Zend_Paginator::setDefaultScrollingStyle('Sliding');
     Zend_Paginator::setDefaultItemCountPerPage(3);
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('partials/pagination.phtml');
 }
开发者ID:hollusion,项目名称:Netons,代码行数:6,代码来源:Bootstrap.php

示例9: _paginator

 /**
  * @param $baseSelect
  * @param int $page
  * @param null $countSelect
  * @return Zend_Paginator
  */
 protected function _paginator($baseSelect, $page = 0, $countSelect = null)
 {
     $adapter = new Zend_Paginator_Adapter_DbTableSelect($baseSelect);
     if (null != $countSelect) {
         $adapter->setRowCount($countSelect);
     }
     $paginator = new Zend_Paginator($adapter);
     $paginator->setDefaultItemCountPerPage($this->_maxItemsOnPage);
     if (!empty($page)) {
         $paginator->setCurrentPageNumber($page);
     }
     return $paginator;
 }
开发者ID:uglide,项目名称:zfcore-transition,代码行数:19,代码来源:Abstract.php

示例10: _initPaginator

 public function _initPaginator()
 {
     Zend_Paginator::setDefaultItemCountPerPage(3);
     Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
 }
开发者ID:html,项目名称:PI,代码行数:5,代码来源:Bootstrap.php

示例11: fetchAll

	public function fetchAll($model, $where=null, $order=null, $count=null, $offset=null)
	{
		//TODO validate model?
		if (!is_object($model))
		{
			throw new $this->_exceptionClass("Invalid model passed to fetchAll function");
		}
		//$db = $this->getDbTable()->getAdapter();
		if (is_object($where))
		{
			$select = $where;
		}
		else
		{
			$select = $this->getDbTable()->select();
			//$select = $db->select();
			//$select->from($this->getTableName());
			if (!empty($where))
			{
				$select->where($where);
			}
		}
		$select->order($order);
		//echo $select->__tostring();
		//echo "<br />";
		$adapter = new Shinymayhem_Paginator_Adapter_DbSelect($select);
		$adapter->setModel($model);
		$paginator = new Zend_Paginator($adapter);
		//default to fetch all, fetch paginated on demand
		$paginator->setDefaultItemCountPerPage(-1);
		return $paginator;
	}
开发者ID:rwilson04,项目名称:Shiny-Library,代码行数:32,代码来源:Mapper.php


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