Welcome Guest, Not a member yet? Register   Sign In
what $string = $this->load->view('myfile', '', true) exactly does?
#5

[eluser]mddd[/eluser]
Note: another way to pass variables to a view is to use $this->load->vars. An example:
Code:
// example 1

$data = array();
$data['title'] = 'My Title';
$data['heading'] = 'My Heading';
$this->load->vars($data);
// now the variables will be available in the view as $title and $heading.
$this->load->view('my_view');

// example 2

$this->load->vars('title', 'My Title');
$this->load->vars('heading', 'My heading');
// same thing. only now you pass 1 variabele at a time, by giving name and value.
$this->load->view('my_view');
No matter how you pass them, variables are available to ALL views you load afterwards!


Messages In This Thread
what $string = $this->load->view('myfile', '', true) exactly does? - by El Forum - 08-20-2010, 04:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB