我在我的控制器中使用它,
function phpcalview()
{
$year = $this->input->post('yearvv');
$year1 = $year+1;
//echo $year1;
$this->load->view('phpcal',$year1);
}
如何$year1
重视我的观看次数phpcal
,并在文本框中获取该值yearvv
答案 0 :(得分:2)
function phpcalview()
{
$year = $this->input->post('yearvv');
$data['year1'] = $year+1;
$this->load->view('phpcal',$data);
}
在视图中:
echo $year1;
答案 1 :(得分:1)
如果您想“在文本框yearvv
中获取该值”,请将其放在您的视图中:
<input type="text" name="yearvv" value="<?=$year1?>" />