passing data from view to controller |
[eluser]jupiter1031[/eluser]
I am new to CI and have a basic question: I have an overview page that successfully displays all projects of a company. This is an overview page. Every item has a link to a detail view. As I understand I write another controller method that will go to the database - get the detail data and display them in a view method. Concretely in this view is a picture, when I click on it I should get a new screen of a detail view of that item. In this case more pictures and more information. My problem is how to pass the index/key of that item to the controller method to display a specific view? It seems pretty basic but I did not find specific information in the documentations. Please provide a simple example. So I don't have to ask back. Or guide me to a specific area in the documentation to get more information on this topic.
[eluser]WanWizard[/eluser]
Use a URI segment: Code: /controller -> calls the index the index method
[eluser]jupiter1031[/eluser]
I hope I got this: <div id="image"> <a >prj_index);?>?>"> <?php echo img($image_properties); ?> </a> </div> on the receiving end how tdo I accept the key? right now the controller method looks like this: function put_project_detail() { $this->load->model('projects_model'); $data['records'] = $this->projects_model->getOneProject(); $this->load->view('eng-project-detail',$data);} } I need to pass the key to procects_model->getOneProject() Thank you for your help!!
[eluser]WanWizard[/eluser]
Take some time to read the user guide carefully, it is very good, and explains most questions beginners have. In this case: http://ellislab.com/codeigniter/user-gui...passinguri |
Welcome Guest, Not a member yet? Register Sign In |