I have problem when i transfer value from view to controller. I don't get the value
Here's my method
Manifest.php
<?php foreach($voyage_info as $voyage) { ?>
<input type="hidden" name="voyage_id" value="<?=$voyage->voyage_id?>">
<a class="btn btn-primary primary-bg btn-lg col-md-2 m-3 btn-cus" href="<?php echo base_url('PortClient/view_voyage/');?>">
<h3>Voyage - <?=$voyage->voyage_number?></h3>
<small>Schedule - <?=$voyage->expected_arrival?> </small>
</a>
<?php } ?>
I want to get the value of voyage_id(Code above) in manifest.php(view page) and transfer it to controller.
Here's my controller
PortClient.php
public function view_voyage() {
$this->Auth->authCheck();
$data = $this->template();
$voyage_id = $this->session->userdata('voyage_id');
$data['view_cargo'] = $this->PortManifestModel->view_voyage($voyage_id)->result();
// your code here
$this->load->view("port/client/sub_manifest/sub_manifest_1", $data);
}
and i will call it using $this->session->userdata() but it doesnt transfer.
What should I do?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…