views:

36

answers:

2

I use this in my controller,

function phpcalview()
{
    $year = $this->input->post('yearvv');
    $year1 = $year+1;
    //echo $year1;
    $this->load->view('phpcal',$year1); 
}

How to $year1 value to my view phpcal and get that value in the textbox yearvv

+2  A: 
function phpcalview()
{
    $year = $this->input->post('yearvv');
    $data['year1'] = $year+1;
    $this->load->view('phpcal',$data); 
}

in view:

echo $year1;
Adam Kiss
+1  A: 

If you want to "get that value in the textbox yearvv" put this in your view:

<input type="text" name="yearvv" value="<?=$year1?>" />
Finbarr