我有这个观点
?php echo $this->Form->create('Search', array('id' => 'Search', 'url' => array('controller' => 'mycontroller', 'action' => 'index'))); ?>
<?php echo $this->Form->input('usuario_id', array('label' => __('Vendedores', true), 'options' => $vendedores, 'empty' => true)); ?>
<?php echo $this->Form->input('cliente_id', array('label' => __('Cliente', true), 'options' => $clientes, 'empty' => true)); ?>
<?php echo $this->Location->estados(); ?>
<?php echo $this->Location->municipios(); ?>
<?php echo $this->Location->bairros(); ?>
<?php echo $this->Form->input('equipe_id', array('label' => __('Equipe', true), 'options' => $equipe, 'empty' => true)); ?>
<?php echo $this->Form->input('veiculo_id', array('label' => __('Modelo', true), 'options' => $veiculos, 'empty' => true)); ?>
<?php echo $this->Form->input('status', array('label' => __('Status', true), 'options' => $status, 'empty' => true,'multiple' => true )); ?>
<?php echo $this->Utils->data('date_from', array('input' => array('label' => 'De'))); ?>
<?php echo $this->Utils->data('date_to', array('input' => array('label' => 'a'))); ?>
<?php echo $this->Form->hidden('Search.search'); ?>
<?php echo $this->Form->end('Buscar'); ?>
和我的控制器分页条件是这样的
if(!empty($this->data['Search']['myvar_id'];)) $this->paginate['conditions']['myModel.myvar_id'] = $this->data['Search']['myvar_id'];
所有搜索字段都工作正常,在#1 页面中,没关系,但是当我分页到#2 页面时,值被清除。如您所见,我在表单上使用了 post 方法,所以使用这种情况,我如何确定当我分页时值不会丢失?
先谢谢了!