I have the following code in my calls/index.ctp. At the moment it is showing all records in one page. I want to limit 20 records per page. When I baked the project, the pagination was provided, but I'm still a beginner and doesn't know how to change the pagination. Can someone please help?
calls/index.ctp:
<div class="callsIndex">
<h2><?php echo __('Call Details'); ?> </h2>
<div class="bottomButtonnew"><?php echo $this->Html->link(__('Add Calls'), array('action' => 'add')); ?></div>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('Call Date'); ?></th>
<th><?php echo $this->Paginator->sort('Call Time'); ?></th>
<th><?php echo $this->Paginator->sort('Comments'); ?></th>
<th><?php echo $this->Paginator->sort('Next Call Date'); ?></th>
<th><?php echo $this->Paginator->sort('Customer Name'); ?></th>
<th><?php echo $this->Paginator->sort('Company Name'); ?></th>
<th><?php echo $this->Paginator->sort('Employee Name'); ?></th>
<th class="actions"><?php echo __(''); ?></th>
</tr>
<?php foreach ($calls as $call): ?>
<tr>
<td><?php echo date("d-m-Y", strtotime($call['Call']['call_date'])); ?> </td>
<td><?php echo h($call['Call']['call_time']); ?> </td>
<td><?php echo h($call['Call']['comments']); ?> </td>
<td><?php echo date("d-m-Y", strtotime($call['Call']['next_call_date'])); ?> </td>
<td>
<?php echo $this->Html->link($call['Customers']['customer_name'], array('controller' => 'customers', 'action' => 'view', $call['Customers']['id'])); ?>
</td>
<td>
<?php echo $this->Html->link($call['Companies']['company_name'], array('controller' => 'companies', 'action' => 'view', $call['Companies']['id'])); ?>
</td>
<td>
<?php echo $this->Html->link($call['Employees']['employee_name'], array('controller' => 'employees', 'action' => 'view', $call['Employees']['id'])); ?>
</td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $call['Call']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<p>
<?php
echo $this->Paginator->counter(array(
'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total')
));
?> </p>
<div class="paging">
<?php
echo $this->Paginator->prev('< ' . __('previous'), array(), null, array('class' => 'prev disabled'));
echo $this->Paginator->numbers(array('separator' => ''));
echo $this->Paginator->next(__('next') . ' >', array(), null, array('class' => 'next disabled'));
?>
</div>
<br>
</div>
callsController:
<?php
App::uses('AppController', 'Controller');
class CallsController extends AppController {
public $components = array('Paginator');
public $paginate = array(
'limit' => 10
);
public function index() {
$userid=$this->Session->read('User.userid');
if(isset($userid)&&$userid!=null)
{
$this->Call->recursive = 0;
$this->set('calls', $this->Paginator->paginate());
$result=$this->Call->getcalls($userid);
$this->set('result', $result);
}
else{
$this->set('loggedout',"loggedout");
$this->render("../Pages/home");
$this->layout = '../Pages/home';
}
}
//some code
}
You can do it easily by using pagination component.You should do it in your AppController.In your AppController you can type below code
Public $components =array('paginator');
public function beforeFilter()
{
parent::beforeFilter();
$this->Paginator->settings=array(
'limit'=>10
);
}
Than in you index method just change this line
$this->set('calls', $this->Paginator->paginate());
I think that will work fine now.This code will work for all controller.But if you want to change this only your CallsController. Do this code.
<?php
App::uses('AppController', 'Controller');
class CallsController extends AppController {
public $components = array('Paginator');
public function index() {
$this->Paginator->settings = array(
'limit' => 10
);
$userid=$this->Session->read('User.userid');
if(isset($userid)&&$userid!=null)
{
$this->Call->recursive = 0;
$this->set('calls', $this->Paginator->paginate());
$result=$this->Call->getcalls($userid);
$this->set('result', $result);
}
else{
$this->set('loggedout',"loggedout");
$this->render("../Pages/home");
$this->layout = '../Pages/home';
}
}
//some code
}
Note : There is two way to apply pagination one is by using component another is in controller.
The correct call in your example should be like this:
$this->set('calls', $this->paginate());
So your code is:
<?php
App::uses('AppController', 'Controller');
class CallsController extends AppController {
public $components = array('Paginator');
public $paginate = array(
'limit' => 10 //Here can you change the default limit
);
public function index() {
$userid=$this->Session->read('User.userid');
if(isset($userid)&&$userid!=null)
{
$this->Call->recursive = 0;
$this->set('calls', $this->paginate());
$result=$this->Call->getcalls($userid);
$this->set('result', $result);
}
else{
$this->set('loggedout',"loggedout");
$this->render("../Pages/home");
$this->layout = '../Pages/home';
}
}
//some code
}
<?php
App::uses('AppController', 'Controller');
class CallsController extends AppController {
public $components = array('Paginator');
public $paginate = array(
'limit' => 20
);
}
Related
I'm trying to learn how CakePHP works but i'm stuck, i just want to display the user names . I'm working in the good controller and the good view... I don't understand .
View => Users => index.ctp
<h1>Users List</h1> <table>
<tr>
<th>Username</th>
</tr>
<?php foreach ($users as $k): ?>
<tr>
<td><?php echo $k['username']; ?></td>
</tr>
<?php endforeach; ?>
</table>
Controller => UsersController
<?php
class UsersController extends AppController{
public function index() {
$users = $this->User->find('all',array('fields' => array('id','username','created')));
debug($users);
}
}
?>
With debug, i have what i want but i can't display the result in my table with foreach .
array(
(int) 0 => array(
'User' => array(
'id' => '2',
'username' => 'CREAZ',
'created' => '2014-06-17 23:39:52'
)
),
(int) 1 => array(
'User' => array(
'id' => '3',
'username' => 'test2',
'created' => '2014-06-18 16:57:37'
)
)
)
The errors i get in my view :
Notice (8): Undefined variable: users [APP\View\Users\index.ctp, line 9]
Warning (2): Invalid argument supplied for foreach() [APP\View\Users\index.ctp, line 9]
Notice (8): Undefined variable: users [APP\View\Users\index.ctp, line 13]
Warning (2): Invalid argument supplied for foreach() [APP\View\Users\index.ctp, line 13]
You should set the users variable in the controller first as shown below:
<?php
class UsersController extends AppController{
public function index() {
$users = $this->User->find('all',array('fields' => array('id','username','created')));
debug($users);
$this->set('users', $users);
}
}
?>
and in the view index.ctp, do it like below:
<h1>Users List</h1>
<table>
<tr>
<th>Username</th>
</tr>
<?php foreach ($users as $k): ?>
<tr>
<td><?php echo $k['User']['username']; ?></td>
</tr>
<?php endforeach; ?>
</table>
I have 4 tables named customers, calls, employees and companies. Customers belong to a company and an employee. Calls belong to a customer and an employee. At the moment in my call index file it shows the relevant customer name and employee name. I want to display, for a call the relevant customer name, the customers company name they belong to and the employee name. I don't know how to display the relevant company name based on the customer. Can someone help? This is my code:
call/ index.ctp
<?php
$usertype=$this->SESSION->read('User.usertype');
?>
<div class="calls index">
<h2><?php echo __('Call Details'); ?> </h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id'); ?></th>
<th><?php echo $this->Paginator->sort('Call Date'); ?></th>
<th><?php echo $this->Paginator->sort('Call Time'); ?></th>
<th><?php echo $this->Paginator->sort('Comments'); ?></th>
<th><?php echo $this->Paginator->sort('Next Call Date'); ?></th>
<th><?php echo $this->Paginator->sort('Customer Name'); ?></th>
<th><?php echo $this->Paginator->sort('Employee Name'); ?></th>
<th class="actions"><?php echo __(''); ?></th>
</tr>
<?php foreach ($calls as $call): ?>
<tr>
<td><?php echo h($call['Call']['id']); ?> </td>
<td><?php echo h($call['Call']['call_date']); ?> </td>
<td><?php echo h($call['Call']['call_time']); ?> </td>
<td><?php echo h($call['Call']['comments']); ?> </td>
<td><?php echo h($call['Call']['next_call_date']); ?> </td>
<td>
<?php echo $this->Html->link($call['Customers']['customer_name'], array('controller' => 'customers', 'action' => 'view', $call['Customers']['id'])); ?>
</td>
<td>
<?php echo $this->Html->link($call['Employees']['employee_name'], array('controller' => 'employees', 'action' => 'view', $call['Employees']['id'])); ?>
</td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $call['Call']['id'])); ?>
</td>
</tr>
callsController:
class CallsController extends AppController {
/**
* Components
*
* #var array
*/
public $components = array('Paginator');
/**
* index method
*
* #return void
*/
public function index() {
$this->Call->recursive = 0;
$this->set('calls', $this->Paginator->paginate());
}
/**
* view method
*
* #throws NotFoundException
* #param string $id
* #return void
*/
public function view($id = null) {
if (!$this->Call->exists($id)) {
throw new NotFoundException(__('Invalid call'));
}
$options = array('conditions' => array('Call.' . $this->Call->primaryKey => $id));
$this->set('call', $this->Call->find('first', $options));
}
/**
* add method
*
* #return void
*/
public function add() {
if ($this->request->is('post')) {
$this->Call->create();
if ($this->Call->save($this->request->data)) {
$this->Session->setFlash(__('The call has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The call could not be saved. Please, try again.'));
}
}
$customers= $this->Call->Customers->find('list',array('order'=>'customer_name ASC','fields'=>array('id','customer_name')));
$employees= $this->Call->Employees->find('list',array('order'=>'employee_name ASC','fields'=>array('id','employee_name')));
$this->set(compact('customers', 'employees'));
}
/**
* edit method
*
* #throws NotFoundException
* #param string $id
* #return void
*/
public function edit($id = null) {
if (!$this->Call->exists($id)) {
throw new NotFoundException(__('Invalid call'));
}
if ($this->request->is(array('post', 'put'))) {
if ($this->Call->save($this->request->data)) {
$this->Session->setFlash(__('The call has been saved.'));
return $this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The call could not be saved. Please, try again.'));
}
} else {
$options = array('conditions' => array('Call.' . $this->Call->primaryKey => $id));
$this->request->data = $this->Call->find('first', $options);
}
$customers= $this->Call->Customers->find('list',array('order'=>'customer_name ASC','fields'=>array('id','customer_name')));
$employees= $this->Call->Employees->find('list',array('order'=>'employee_name ASC','fields'=>array('id','employee_name')));
$this->set(compact('customers', 'employees'));
}
/**
* delete method
*
* #throws NotFoundException
* #param string $id
* #return void
*/
public function delete($id = null) {
$this->Call->id = $id;
if (!$this->Call->exists()) {
throw new NotFoundException(__('Invalid call'));
}
$this->request->onlyAllow('post', 'delete');
if ($this->Call->delete()) {
$this->Session->setFlash(__('The call has been deleted.'));
} else {
$this->Session->setFlash(__('The call could not be deleted. Please, try again.'));
}
return $this->redirect(array('action' => 'index'));
}}
the array looks like this:
Array
(
[Call] => Array
(
[id] => 7
[call_date] => 2013-04-27
[call_time] => 08:31:00
[comments] => Require installation
[next_call_date] => 2014-04-27
[customers_id] => 2
[employees_id] => 3
)
[Customers] => Array
(
[id] => 2
[customer_name] => Snith Jams
[customer_address] => 192 Waverley Road
[customer_suburb] => Caulfield East
[customer_state] => VIC
[customer_postcode] => 3145
[customer_dob] => 2014-04-09
[customer_anniversary] => 2014-04-10
[customer_phone1] => 0492832921
[customer_phone2] => 0392817894
[customer_phone3] => 0482938281
[customer_fax] =>
[customer_email] => tsmith#hotmail.com
[customer_gender] => M
[customer_type] => Silver
[customer_PW] => a1c680c2bfcca40816dd81eff3980cc9828c9088
[customer_username] => samman
[companies_id] => 3
[employees_id] => 11
)
[Employees] => Array
(
[id] => 3
[employee_name] => Jones
[date_hired] => 2013-02-04
[employee_phone_number] => 0449997582
[employee_email] => indianajones#gmail.com
[employee_address] => 22 Queens street Melbourne CBD
[employee_dob] => 1966-01-31
[access_level] => staff
[employee_username] => jones12
[employee_pw] => 603fce7dcbec3c9cba24e87d058a3341e37779b8
)
)
callsController:
public $components = array('Paginator');
public function index() {
$this->Call->recursive = 2;
$this->set('calls', $this->Paginator->paginate());
}
calls/index.ctp:
<div class="calls index">
<h2><?php echo __('Call Details'); ?> </h2>
<table cellpadding="0" cellspacing="0">
<tr>
<th><?php echo $this->Paginator->sort('id'); ?></th>
<th><?php echo $this->Paginator->sort('Call Date'); ?></th>
<th><?php echo $this->Paginator->sort('Call Time'); ?></th>
<th><?php echo $this->Paginator->sort('Comments'); ?></th>
<th><?php echo $this->Paginator->sort('Next Call Date'); ?></th>
<th><?php echo $this->Paginator->sort('Customer Name'); ?></th>
<th><?php echo $this->Paginator->sort('Company Name'); ?></th>
<th><?php echo $this->Paginator->sort('Employee Name'); ?></th>
<th class="actions"><?php echo __(''); ?></th>
</tr>
<?php foreach ($calls as $call): ?>
<tr>
<td><?php echo h($call['Call']['id']); ?> </td>
<td><?php echo h($call['Call']['call_date']); ?> </td>
<td><?php echo h($call['Call']['call_time']); ?> </td>
<td><?php echo h($call['Call']['comments']); ?> </td>
<td><?php echo h($call['Call']['next_call_date']); ?> </td>
<td>
<?php echo $this->Html->link($call['Customers']['customer_name'], array('controller' => 'customers', 'action' => 'view', $call['Customers']['id'])); ?>
</td>
<td>
<?php echo $this->Html->link($call['Customers']['Companies']['company_name']); ?>
</td>
<td>
<?php echo $this->Html->link($call['Employees']['employee_name'], array('controller' => 'employees', 'action' => 'view', $call['Employees']['id'])); ?>
</td>
<?php echo pr($call); ?>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('action' => 'view', $call['Call']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
just set recursive to 2
$this->Call->recursive = 2;
(or $this->Calls->recursive = 2 it depends if your model is Call or Calls)
and you can access to Company information like this
$call['Customer']['Company']['name']
Because it seems you are not following cake naming conventions (you are using plural for Models' names) maybe you'll need to use
$call['Customers']['Companies']['name']
I suggest you to follow the conventions, anyway if you print your array doing pr($call); you'll see how the array is structured and how to access your data
I am currently trying to solve a problem which I just noticed since the property didn't actually have a main_image allocated to it.
But as soon as I allocated a main image to it. The Related images caused problems.
Property table has a belongsTo relation
public $belongsTo = array( 'Image' => array(
'className' => 'Image',
'foreignKey' => 'main_image_id'
));
and also a hasMany
public $hasMany = array(
'Image' => array(
'className' => 'Image',
'foreignKey' => 'property_id'
)
);
the problem is when I am populating the related images I am receiving multiple errors similar to the below
Illegal string offset 'id'
my data is like so
property(array)
Image(array)
id1
descriptionPainted Brick Design
imageuploads/properties/3/Amazing-Painted-Brick-Houses-Design.jpeg
property_id3
0(array)
id1
descriptionPainted Brick Design
imageuploads/properties/3/Amazing-Painted-Brick-Houses-Design.jpeg
property_id3
and the view was generated like so
<div class="related">
<h3><?php echo __('Related Images'); ?></h3>
<?php if (!empty($property['Image'])): ?>
<table cellpadding = "0" cellspacing = "0">
<tr>
<th><?php echo __('Id'); ?></th>
<th><?php echo __('Description'); ?></th>
<th><?php echo __('Image'); ?></th>
<th><?php echo __('Property Id'); ?></th>
<th class="actions"><?php echo __('Actions'); ?></th>
</tr>
<?php foreach ($property['Image'] as $image): ?>
<tr>
<td><?php echo $image['id']; ?></td>
<td><?php echo $image['description']; ?></td>
<td><?php echo $image['image']; ?></td>
<td><?php echo $image['property_id']; ?></td>
<td class="actions">
<?php echo $this->Html->link(__('View'), array('controller' => 'images', 'action' => 'view', $image['id'])); ?>
<?php echo $this->Html->link(__('Edit'), array('controller' => 'images', 'action' => 'edit', $image['id'])); ?>
<?php echo $this->Form->postLink(__('Delete'), array('controller' => 'images', 'action' => 'delete', $image['id']), null, __('Are you sure you want to delete # %s?', $image['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $this->Html->link(__('New Image'), array('controller' => 'images', 'action' => 'add')); ?> </li>
</ul>
</div>
</div>
I am not sure if maybe the relations are setup incorrectly or that maybe I would have to include an if to see if there is data before the array and then implement a for loop.
I will answer it rather then comment. You will get all the properties and their main image like this (place this in your controller action eg. index()):
$properties= $this->Property->find('all', array(
'contain' => array(
'Image' => array(
'conditions' => array(
'main_image' => true
)
)
)
));
$this->set('properties', $properties);
and in your view:
<img src='<?php echo '/realestateagencyadministration/img/' . $property['Image'][0]['main_image'] ?>' style='max-width: 100%;height:150px;;'>
Don't take my for sure on this last one, I am wrinting this out of my head, I think you need [0], but you can easily fix that.
So how do I fix this? It gives me:
Notice (8): Undefined variable: products
[APP/View/Categories/category_filter.ctp, line 10] Warning (2):
Invalid argument supplied for foreach()
[APP/View/Categories/category_filter.ctp, line 10]
<? if (!empty($categories)) { ?>
<? foreach($categories as $row): ?>
<h1>Category: <?= $row['Category']['category'] ?></h1>
<table>
<tr>
<th>Name</th><th>Description</th><th>Price</th><th>Category</th>
<th>Thumbnails</th>
</tr>
<? foreach($products as $row): ?>
<tr><<td>
<?=$row['Product']['name']?>
</td><td>
<?=$row['Product']['description']?>
</td><td>
<?=$row['Product']['price']?>
</td><td>
<?=$row['Product']['category_id']?>
</td><td>
<?
if(!empty($row['Picture'])){
?>
<?= $this->Html->image('/img/'. $row['Picture'][0]['filename'], array('width'=>'50', 'alt'=>$row['Picture'][0]['title'])); ?>
<p><?= $row['Picture'][0]['description']; ?></p>
<? } ?>
</td><tr>
<? endforeach; ?>
<? endforeach; ?>
</table>
<? } ?>
In the controller
function category_filter($category_id) {
$this->set('categories',$this->Category->findAllById($category_id));
}
You can simply do this by making a Category Model class.
//app/Model/Category.php
class Category extends AppModel
{
public $name = 'Category';
public $useTable = 'categories';
public $primaryKey = 'id';
public $hasMany = array('Products' => array('className' => 'Product',
'foreignKey' => 'category_id'
));
}
//app/Model/Product.php
class Product extends AppModel
{
public $name = 'Product';
public $useTable = 'products';
public $primaryKey = 'id';
}
In your controller:
function category_filter($category_id) {
$this->set('category_details',$this->Category->findById($category_id));
}
In your view:
<h1>Category: <?php echo $category_details['Category']['category'] ?></h1>
<table>
<tr>
<th>Name</th><th>Description</th><th>Price</th><th>Category</th>
<th>Thumbnails</th>
</tr>
<?php if(!empty($category_details['Products'])): foreach($category_details['Products'] as $row): ?>
<tr><td>
<?php echo $row['Product']['name']?>
<?php echo $this->Html->image('/img/'. $row['Picture'][0]['filename'], array('width'=>'50', 'alt'=>$row['Picture'][0]['title'])); ?>
<p><?php echo $row['Picture'][0]['description']; ?></p>
<?php } ?>
</td><tr>
<?php endforeach;endif; ?>
As I do not much aware about your Picture Model. Kindly do the association for that model also in your Product model.
<?php
function category_filter($category_id) {
$this->set('categories',$this->Category->findAllById($category_id));
$products=$this->Product->find('all');
$this->set(compact('products'));
}
?>
set your product variable
I have a project in CakePHP application and I want to add pagination to it. I have added pagination to it, but when I click on a page number or go to the next page my application breaks.
The page relies on variables being passed to the controller in order to display the correct data. Here is my code for the view:
<table class="table table-striped">
<thead>
<tr>
<th>Job ID</th>
<th>Date</th>
<th>Site</th>
<th> </th>
</tr>
</thead>
<tbody>
<?php foreach ($data as $jobsheet) { ?>
<tr>
<td>
<?php echo $jobsheet['Jobsheet']['jobnum']; ?>
</td>
<td>
<?php echo date("l, jS F Y", strtotime($jobsheet['Jobsheet']['jobdate'])); ?>
</td>
<td>
<span class="companyname"><strong><?php echo $jobsheet['Siteaddress']['sitename'] ?></strong></span><br />
<?php echo $jobsheet['Siteaddress']['addressline1']; ?>,
<?php echo $jobsheet['Siteaddress']['addressline2']; ?>,
<?php if ( $jobsheet['Siteaddress']['addressline3'] = '') { ?>
<?php echo $jobsheet['Siteaddress']['addressline3']; ?>,
<?php } else { ?>
<?php } ?>
<?php echo $jobsheet['Siteaddress']['city']; ?>,
<?php echo $jobsheet['Siteaddress']['county']; ?>,
<?php echo $jobsheet['Siteaddress']['country']; ?>,
<?php echo $jobsheet['Siteaddress']['postcode']; ?>
</td>
<td><a data-toggle="modal" href="#viewjobsheet<?php echo $jobsheet['Jobsheet']['id']; ?>" onClick="document.getElementById('jbif<?php echo $jobsheet['Jobsheet']['id']; ?>').src='/modal/customers/<?php echo $company['Company']['id']; ?>/jobs/<?php echo $jobsheet['Jobsheet']['id']; ?>/view/';" title="View" class="icon-eye-open"></a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="controls">
<?php echo $this->Paginator->prev('« Previous', null, null, array('class' => 'disabled')); ?>
<?php echo $this->Paginator->numbers(); ?>
<?php echo $this->Paginator->next('Next »', null, null, array('class' => 'disabled')); ?>
<br />
<br />
<?php echo $this->Paginator->counter(array(
'format' => 'Page {:page} of {:pages}, showing {:current} records out of
{:count} total, starting on record {:start}, ending on {:end}'
));
?>
</div>
</div>
This is the controller:
function index(){
$companyid = $this->params['customer'];
$this->set('companyid', $companyid);
$siteid = $this->params['site'];
$this->loadModel('Jobsheet');
// Job Sheets
$jobsheets = $this->Jobsheet->find('all', array('conditions' => array('Jobsheet.company' => $companyid), 'recursive' => 2, 'order' => 'Jobsheet.jobdate DESC', 'limit' => '10'));
$this->set('jobsheets', $jobsheets);
$this->paginate = array(
'limit' => 10
);
$data = $this->paginate('Jobsheet');
$this->set(compact('data'));
}
While the pagination does work, it ends up loosing the variable and this breaks what I'm trying to do. What am i missing?
One method is to use PaginatorHelper::options (see the API)
For example, say we want to pass the variable $pass between Paginator page changes. So first pass the variable to the View.
public function index() {
$pass = 'testString';
$this->set(compact('pass'));
$this->set('posts', $this->paginate());
}
In the View, we can then add this to the parameters that Paginator passes when changing pages using Paginator::options and the url option.
<?php
$this->Paginator->options(array(
'url' => array(
'pass' => $pass
)
));
?>
So if you moved from page 1 to page 2, the resulting url would be something similar to:
http://localhost/cake/posts/index/pass:testString/page:2
This is also how Paginator passes sort orders and sort keys. So while "pass" in pass:testString can be anything you want, be sure not to use sort, direction, and page.
As long as you are changing pages through the Paginator links, the passed variables will remain. Note that you can access the values of the passed arguments in both the View and the Controller by the property:
$this->passedArgs