开发者

Return a value not an array from a controller to view php codeigniter

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


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

in view:

echo $year1;


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

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜