Jump to content

Archived

This topic is now archived and is closed to further replies.

Yohanne

CI store two function in one view

Recommended Posts

Hi, 

 

i have two methods with different function, each is calling to view a record from database. now i want store this two methods into one view.  

 

 

ex.

model


function 1()
 {
   table_0ne
 }
function 2()
 {
   table_two
 }

controller

function 1()
 {
   view 1,2
 }

it is possible, please help.. and i have code below, and it is not work when i apply $datax

public function generate_po()
	{
		$po_id = $this->input->post('selector');
				
		$data['result'] =  $this->public_base_model->generate_po($po_id);
		$datax['result'] = $this->public_base_model->get_max_num();
					
		if($this->session->userdata('logged_in'))
			{
				$session_data = $this->session->userdata('logged_in');
				$data['username'] = $session_data['username'];
				$data['fname'] = $session_data['fname'];
				$data['userid'] = $session_data['userid'];
				$this->load->view('generate_po', $data, $datax);
											
			}
		else
			{
				$this->load->view('login');
			}
			}

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.