Welcome Guest, Not a member yet? Register   Sign In
how to pass data array into layout at Phil’s template library?
#1

[eluser]Unknown[/eluser]
please advice.

how to pass data array into layout at Phil’s template library?
so far, i just can view the data successfully at the view only, not in layout.
i.e. $this->template->build('home', $data);

but it will get error if we do at layout:
$this->template->set_layout('main', $data);

regards,

hadi
#2

[eluser]InsiteFX[/eluser]
Did you red Phil's documentation on the template library?

InsiteFX
#3

[eluser]Unknown[/eluser]
sadly, i didn't find yet about this method at phil's documentation.

now, i just do optimization the passing array data from controller to view only not in layout, that need repeated at other views.

regards,

hadi
#4

[eluser]InsiteFX[/eluser]
Makes $data global to all views!
Code:
$this->load->vars($data);

$this->load->view('your_view');

CodeIgniter User Guide Loader Class.

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB