function new_order_details()
{
$this->load->view('sales/new_order_details');
}
<form id="sales_order_details" action="/sales/new_blank_order_lines" method="post">
<input type="text" id="customer" />
<input type="submit" name="blank_order" id="blank_order" value="Continue">
</form>
function new_blank_order_lines()
{
$data = array(
'customer' =>$this->input->post('customer')
);
$this->load->view('sales/new_blank_order_lines',$data);
}
<?php echo "--" . $customer . "--"; ?>
上述输出是变量$客户为空。
它是空的,因为您尚未将姓名参数授予View File中的客户输入字段。写下html如下
<input type="text" id="customer" name="customer" />
您的输入中缺少名称attre..
<input type="text" id="customer" name="customer"/>
//----^^^^^^^----- here
然后将其名称提供给控制器