Welcome Guest, Not a member yet? Register   Sign In
how to get the variable value from controller in the view
#1

[eluser]luffy[/eluser]
I have read the view user guide
http://ellislab.com/codeigniter/user-gui...views.html

I found it's not smarty to get the variable value from controller.

$data['title'] = "My Real Title";
$data['heading'] = "My Real Heading";
$this->load->view('blogview', $data);


In zend framework, If I want to do the same function.
$this->view->abc = 'test';

And then, I can use $this->abc in the view file.

Does Ci have the same function?
#2

[eluser]PromaneX[/eluser]
If you used $data['title'] then your view just needs to use $title to get at the data stored in there. <?=$title?>




Theme © iAndrew 2016 - Forum software by © MyBB