我有以下语法:
位指示
function new_auto_spread_details()
{
$postinfo = array();
$postinfo[] = $this->input->post('customer')
$postinfo[] = $this->input->post('period')
$this->load->view('sales/new_autospread_order_lines',$postinfo);
}
查看
<?php echo $postinfo['customer']; ?>
<?php echo $postinfo['period']; ?>
这不会输出任何内容。似乎将$this->input->post('customer')
添加到数组postinfo是不正确的。
如何正确地将此信息添加到postinfo数组并从视图中调用它?
一如既往地谢谢......
答案 0 :(得分:2)
function new_auto_spread_details()
{
$postinfo = array();
$data['postinfo']['customer'] = $this->input->post('customer');
$data['postinfo']['period'] = $this->input->post('period');
$this->load->view('sales/new_autospread_order_lines',$data);
}
在视图
上<?php echo $postinfo['customer']; ?>
<?php echo $postinfo['period']; ?>