Answers for "limit pagination page number cakephp"

PHP
2

limit pagination page number cakephp

$all_settings = array(
  'limit' => 100,	// limit pagination page number: 100 record / page
  'fields' => array(
    'Product.*',
  ),
  'conditions' => $conditions, 
  'order' => array(
    'Product.is ASC',
  ),
  'contain' => array(
    'ProductLanguage' => array(
      'conditions' => array(
        'ProductLanguage.alias' => $this->lang18,
      ),
      'fields' => array(
        'ProductLanguage.title',
      ),
    ),
  ),
  'recursive' => -1, 
);

$this->Paginator->settings = $all_settings;
$products = $this->paginate();
Posted by: Guest on December-21-2020
2

cakephp pagination

// admin_index

$all_settings = array(
  'contain' => array(
    'CreditType' => array(
      'CreditTypeLanguage' => array(
        'conditions' => array(
          'CreditTypeLanguage.alias' => $this->lang18, // 'zho', 'eng', 'chi'
        ),
      ),
    ),
  ),
  'recursive' => 0,
);

$this->Paginator->settings = $all_settings;
$companyCredits = $this->paginate();
$this->set(compact('companyCredits'));
Posted by: Guest on October-13-2020

Browse Popular Code Answers by Language