Welcome Guest, Not a member yet? Register   Sign In
Pass data from view to controller
#4

(This post was last modified: 09-09-2019, 11:25 AM by demyr.)

PHP Code:
public function car()
    {  
            $id 
$this->uri->segment(2);
            $this->load->model('Vehicle_Model);
            $data['
vehicle'] = $this->Vehicle_Model->get_vehicle_by_id($id);
            $this->load->view('
car', $data);
    } 


Also, are you sure about the $id?
try it first with this:


PHP Code:
public function car()
    {  
            $id 
$this->uri->segment(2);
  echo $id;
  die();


Plus, in your view use them this way

           
PHP Code:
<?php echo $vehicle_item->description?>
Reply


Messages In This Thread
RE: Pass data from view to controller - by demyr - 09-09-2019, 11:23 AM
RE: Pass data from view to controller - by demyr - 09-11-2019, 06:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB