Passing of parameters |
[eluser]Nikhil Vijayan[/eluser]
if you want to pass the data to controlle when the FORM is submitted , the way to do it is like Code: <form name="form1"> so u will get the data in controller when the submit button is clicked as Code: $var_name = $_POST['var_name']; or in ci way Code: $var_name = $this->input->post('var_name'); also there is alterantive way by passing it thru url .
[eluser]crumpet[/eluser]
what you called your form in your second post doesn't look like a form ... there are no form elements which means you can't use the hidden form .. unless you actually have a form I thin you need to use the url option you make the function your linking to take the id as a parameter and then dynamically generate the link to be site_url('controller/function/'.$quote['QUOTE_NO']
[eluser]GrootBaas[/eluser]
Thanks for your input.... How would I brake the parameter away in the controller then?
[eluser]crumpet[/eluser]
You can store it in a session variable and access it later... but I would recommend doing the url thing juding by what I think your trying to accomplish. Thats how I pass ID numbers around in all my code.
[eluser]bluepicaso[/eluser]
This seems old but i need help. I've a loop on a view that generates name of the main categories i want if someone clicks on it it should show the list of products under it.. Initially when i used raw php...it was clear to me below it the raw php code, that shows what i want to do Code: <?php But please help to understand that how should i do it with CI i have something like this Code: <td> Please help
[eluser]crumpet[/eluser]
Your controller needs to have a function that takes an argument like $id i function my_function($id){ //use the id to fetch a db entry } then you pass the argument as the last component of the url eg. www.example.com/my_controller/my_function/id
[eluser]bluepicaso[/eluser]
thanx actully i discovered a problem in my htaccess file....there was something that was hindering it. well could you please tell me how to send the data from the controller function to the model....Please help
[eluser]crumpet[/eluser]
when you call a model function just pass whatever data you want to it as a parameter. so like model: function get_entry($id){ //access db and return entry } controller: function my_function($id){ $entry = $my_model->get_entry($id) // pass entry to the view to display it }
[eluser]bluepicaso[/eluser]
Wow thanx a lot....That was really helping.. Actually i"m new to Ci i worked on raw PHP....so u know |
Welcome Guest, Not a member yet? Register Sign In |