PHP - CodeIgniter How to pass variables to 2 view but load only one of them?

0

Currently the arrays (variables) sent them correctly to a view, but it turns out that this is a modal and I want the variables to also reach the main view (this second one without loading it, only that they are stored temporarily in it).

Here the code that works correctly with a single view:

$proyeccion = $this -> data['proyeccion'] = $this -> cnm_liquidacioncuotas -> CnmCalcularCuotasVista($datos, $fecha_activacion, $medio_pago, $hipotecario, $reliquidacion, $refinanciacion);

$this -> data['seguros_vida'] = $this -> cnm_calculosegurosvi -> calculoSegurosVida($datos, $proyeccion);

$this -> data['seguros_incendio'] = $this -> cnm_calculosegurosvi -> calculoSegurosIncendio($datos, $proyeccion);

if ($hipotecario == 'true')
    {
      $this -> load -> view('carteranomisional/carteranomisional_visualizar_proyeccion', $this -> data);          
    }

Again, the sent to this view is done correctly with the arrays $ this - > data [] . But I want to send them to a second view without the $ this - > load - > view () , since this one loads me another page again, which is not correct.

    
asked by Luis Arcos 20.10.2017 в 17:15
source

1 answer

0

In this case I would recommend you use Ajax requests, so you can bring the data whenever you need them. Here is an example of how to use ajax and codeigniter.

link

    
answered by 20.10.2017 в 18:01