1

I have the following syntax:

Contoller

  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);
  }

View

<?php echo $postinfo['customer']; ?>
<?php echo $postinfo['period']; ?>

This does not output anything. it seems that adding $this->input->post('customer') to the array postinfo is not correct.

How do I correctly add this information to the postinfo array and call it from the view?

1
  • The missing semicolons in your controller method will certainly break your script. Commented Feb 18 at 4:35

1 Answer 1

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);
  }

on view

<?php echo $postinfo['customer']; ?>
<?php echo $postinfo['period']; ?>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.