开发者

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

开发者 https://www.devze.com 2022-12-27 03:37 出处:网络
I use this in my controller, function phpcalview() { $year = $this->input->post(\'yearvv\'); $year1 = $year+1;

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

精彩评论

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