Welcome Guest, Not a member yet? Register   Sign In
Why to catch a variable in View to controller
#3

[eluser]ludo31[/eluser]
[quote author="meigwilym" date="1330347679"]The user guide explains all of this. http://ellislab.com/codeigniter/user-gui...views.html

If you're having trouble with the language come back and I'll explain.

Mei[/quote]

Thanks , but please can you explain me the lats paragraph

Code:
$this->load->view('site_view',$data, true);

My problem is like this : in my controller I need one value as id in 2 functions :

// I need to use for example the title number = 079 in 2 functions

Code:
// my first function

function index(){
        
            // for eample it return 079
        $data['id']=$this->site_model->getId();

        $data['result']=$this->site_model->AllResult();
        
       $string = $this->load->view('site_view',$data, true);
    
        
    }



// my second function after passing in view file

public function envoyer()
    {
        $data['id']=$this->site_model->getId();

        $data['result']=$this->site_model->AllResult();

         etc .....
      
        
      
    }

in view


can you explain me the utility of this

Code:
$string = $this->load->view('site_view',$data, true);

and My question and my only problem is it possible to $data['id'] for all functions without passing in model for each function because they are linking ????

thanks


Messages In This Thread
Why to catch a variable in View to controller - by El Forum - 02-27-2012, 05:44 AM
Why to catch a variable in View to controller - by El Forum - 02-27-2012, 06:01 AM
Why to catch a variable in View to controller - by El Forum - 02-27-2012, 10:05 AM



Theme © iAndrew 2016 - Forum software by © MyBB