Quantcast
Channel: CodeIgniter Forums - All Forums
Viewing all articles
Browse latest Browse all 14348

View Data Issue

$
0
0
I found a bug for loading view with second array parameter. I use version 3.1.0.

My controller function:

public function test(){
$data=array('a'=>'A','b'=>'B');
$this->load->view('test',$data);
$data=array();
$data=array('b'=>'B');
$this->load->view('test',$data);
}


and this is my TEST view file:

<?php echo $a.'-'.$b.'|';


If you run this structure; it will generate :

A-B|A-B|

but it must generate and give us a notice message that $a not defined:

A-B|-B|

because we don't define $a for second call of view file.

I tried unset($data) but issues still continues.

I don't know why this happens but it can be a buffer problem or somethink else like this.

Viewing all articles
Browse latest Browse all 14348

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>