how to pass a simple parameter in view to controller ? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: how to pass a simple parameter in view to controller ? (/showthread.php?tid=49534) |
how to pass a simple parameter in view to controller ? - El Forum - 02-24-2012 [eluser]ludo31[/eluser] Hello ; I begin with CI and I would like to know how to pass a simple parameter in view to controller .because sometimes , in view we use form_input and other form and to catch them in controller , we use : input->post for example in this example I would like to pass a simple value : $identifiant_chaussure to another controller function site/do_upload Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" and what I make to do that : I put it in input Code: <?php echo form_input('identifiant', $identifiant_chaussure); ?><br/> and in controller I catch it like that Code: public function do_upload() so for the same problem I would like to pass a n array where there are a lot of information thanks how to pass a simple parameter in view to controller ? - El Forum - 02-24-2012 [eluser]Mauricio de Abreu Antunes[/eluser] You have no problems in your code. What error are you getting? how to pass a simple parameter in view to controller ? - El Forum - 02-24-2012 [eluser]meigwilym[/eluser] You need something like this in the controller that controls the view: Code: $data['identifiant_chaussure'] = 'Mon Chaussure'; Mei how to pass a simple parameter in view to controller ? - El Forum - 02-24-2012 [eluser]ludo31[/eluser] No you don't understand , I d like to pass $identifiant_chaussure to Controller without passing by Code: <?php echo form_input('identifiant', $identifiant_chaussure); ?><br/> how to pass a simple parameter in view to controller ? - El Forum - 02-24-2012 [eluser]CroNiX[/eluser] Either using a form and submitting it to a controller, or with an anchor and pass the parameter in a segment. how to pass a simple parameter in view to controller ? - El Forum - 02-24-2012 [eluser]ludo31[/eluser] [quote author="CroNiX" date="1330104637"]Either using a form and submitting it to a controller, or with an anchor and pass the parameter in a segment.[/quote] And how to catch it in controller ??? Code: $this->uri->segment(3) thanks it doesn't work : in my controller Code: <?php in my view Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" how to pass a simple parameter in view to controller ? - El Forum - 02-24-2012 [eluser]InsiteFX[/eluser] Code: public function recevoir() how to pass a simple parameter in view to controller ? - El Forum - 02-26-2012 [eluser]ludo31[/eluser] [quote author="InsiteFX" date="1330125269"] Code: public function recevoir() it returns false form_value does not exist even in doc ?? how to pass a simple parameter in view to controller ? - El Forum - 02-26-2012 [eluser]InsiteFX[/eluser] form_value is the name of your form field! how to pass a simple parameter in view to controller ? - El Forum - 02-26-2012 [eluser]ludo31[/eluser] But here I want just to pass a simple value not a form .$identifiant_chaussure ; in php it'is possible : Code: <a href="bonjour.php?nom=Dupont&prenom=Jean">Dis-moi bonjour !</a> and we catch them Code: <?php I try to do that : <?php echo anchor('site/envoyer', 'Envoyer','title="news title"'); ?> or Code: echo anchor('news/local/123', 'My News', array('title' => 'The best news!')); but I don(t know how to get the value of title |