本文整理汇总了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']);
}
示例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']);
}
}
示例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');
}
示例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');
}
示例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');
}
示例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;
}
示例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();
}
示例8: _initPaginator
protected function _initPaginator()
{
Zend_Paginator::setDefaultScrollingStyle('Sliding');
Zend_Paginator::setDefaultItemCountPerPage(3);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('partials/pagination.phtml');
}
示例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;
}
示例10: _initPaginator
public function _initPaginator()
{
Zend_Paginator::setDefaultItemCountPerPage(3);
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml');
}
示例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;
}