Welcome Guest, Not a member yet? Register   Sign In
how to pass a simple parameter in view to controller ?
#1

[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"
        "http://www.w3.org/TR/html4/loose.dtd">
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Bienvenue dans l'Image&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    <h1>Bienvenue dans l'Image des chaussures </h1>
    
    &lt;?php
    
      
    
        if(isset($identifiant_chaussure))
        {
            echo 'identifiant:'.$identifiant_chaussure ;
        }
        
          
    ?&gt;
    
    
    
    
              &lt;?php echo form_open_multipart('site/do_upload'); ?&gt;
              
              &lt;?php echo form_label('Identifiant', 'chaussure'); ?&gt;<br/>
             &lt;?php echo form_input('identifiant', $identifiant_chaussure); ?&gt;<br/>
        
        
        
                 &lt;input type="file" name="userfile" size="20" /&gt; <br/>
                
                 &lt;?php echo form_button('ajouter','Ajouter'); ?&gt;
        
                    &lt;?php echo form_submit('envoi', 'Envoyer'); ?&gt;
                    
             &lt;?php echo  form_close(); ?&gt;
    
  
    
&lt;/body&gt;
&lt;/html&gt;

and what I make to do that :
I put it in input

Code:
&lt;?php echo form_input('identifiant', $identifiant_chaussure); ?&gt;<br/>

and in controller I catch it like that
Code:
public function do_upload()
             {
                
                  $identifiant_chaussure = $this->input->post('identifiant');

.....}

so for the same problem I would like to pass a n array where there are a lot of information

thanks


Messages In This Thread
how to pass a simple parameter in view to controller ? - by El Forum - 02-24-2012, 02:38 AM
how to pass a simple parameter in view to controller ? - by El Forum - 02-24-2012, 03:42 AM
how to pass a simple parameter in view to controller ? - by El Forum - 02-24-2012, 04:36 AM
how to pass a simple parameter in view to controller ? - by El Forum - 02-24-2012, 10:24 AM
how to pass a simple parameter in view to controller ? - by El Forum - 02-24-2012, 10:30 AM
how to pass a simple parameter in view to controller ? - by El Forum - 02-24-2012, 11:30 AM
how to pass a simple parameter in view to controller ? - by El Forum - 02-24-2012, 04:14 PM
how to pass a simple parameter in view to controller ? - by El Forum - 02-26-2012, 02:29 AM
how to pass a simple parameter in view to controller ? - by El Forum - 02-26-2012, 04:41 AM
how to pass a simple parameter in view to controller ? - by El Forum - 02-26-2012, 01:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB