how to pass a simple parameter in view to controller ? |
[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
[eluser]Mauricio de Abreu Antunes[/eluser]
You have no problems in your code. What error are you getting?
[eluser]meigwilym[/eluser]
You need something like this in the controller that controls the view: Code: $data['identifiant_chaussure'] = 'Mon Chaussure'; Mei
[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/>
[eluser]CroNiX[/eluser]
Either using a form and submitting it to a controller, or with an anchor and pass the parameter in a segment.
[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"
[eluser]InsiteFX[/eluser]
Code: public function recevoir()
[eluser]ludo31[/eluser]
[quote author="InsiteFX" date="1330125269"] Code: public function recevoir() it returns false form_value does not exist even in doc ??
[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 |
Welcome Guest, Not a member yet? Register Sign In |