How to load the webpage served by a CodeIgniter controller method
14:54 20 Mar 2018

Just stared learning CodeIgniter (using v3.1.7). I have this table called training. enter image description here

I followed the steps described in this tutorial:

First, create a model called training_model.php (put it in /application/models)

db->get('training');

            if($q->num_rows() > 0){

            foreach ($q->result() as $row){
                $data[] = $row;
            }
            return $data;
        }
    }

?>

Then create it's controller (training.php), put in /application/controllers.

load->model("training_model"); 
    $data["trainings"]=$this->users_model->get_all_trainings(); 

    $this->load->view("users_view", $data);
  }
}

Last one is the view (training_view.php), put it into /application/views

eventName .' '. $t->eventDescription.' '.$t->eventDate.' '.$t->eventVenue;
    }
}

?>

How to access the view from the browser, so I can see the database's content?

php codeigniter codeigniter-3 url-routing