Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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?

Thanks as always...

share|improve this question

1 Answer

up vote 2 down vote accepted
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']; ?>
share|improve this answer
Legend, thank you! – Smudger 2 days ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.