【发布时间】:2016-04-19 22:21:45
【问题描述】:
我有一个功能可以像这样过滤我的分页器:
public function indextipo() {
$this->CabAsiento->recursive = 0;
$tipo = $this->request->data['tipo'];
$fecha = $this->request->data['fecha_desde'];
$this->Paginator->settings=array(
'paramType' => 'querystring',
'limit'=> 1,
'conditions' => array('CabAsiento.tipo_doc' => $tipo, 'MONTH(CabAsiento.fecha)' => $fecha),
'order' => array('CabAsiento.id_numero' => 'ASC')
);
$this->set('cabAsientos', $this->Paginator->paginate());
$this->layout = 'ingresos';
}
它有 .ctp。
它可以工作并显示过滤器数据,但是当我尝试下一页时,另一个页面给了我:
未定义索引:tipo [APP\Controller\CabAsientosController.php,第 35 行]
未定义索引:fecha_desde [APP\Controller\CabAsientosController.php,第 36 行]
导致参数丢失。 如何保存或存储表单搜索发送的参数:
<div class="portlet-body">
<?php echo $this->Form->create(false, array('action' => 'indextipo','id' => 'form-login1')); ?>
<fieldset>
<?php
echo $this->Form->input('fecha_desde', array('id'=>'fecha_desde1', 'type' => 'date','dateFormat' => 'M','class' => 'span3'));
$arrCategory=array("ing"=>"Ingreso","egre"=>"Egreso","trasp"=>"Trapaso");
echo $this->form->input('tipo',array('type' => 'select','options'=> $arrCategory));
?>
</fieldset>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<?php
echo $this->Form->button("<i class='icon-plus'></i> Buscar", array('type' => 'submit','id' => 'submit_id', 'class' => 'btn green', 'escape' => false, 'aria-hidden'=>"true"));
echo $this->Form->end();
?>
</div>
【问题讨论】:
标签: jquery cakephp cakephp-2.0 cakephp-2.3 cakephp-2.1