07-15-2011, 01:39 AM
[eluser]Unknown[/eluser]
Hi Guys,
I am thinking how to achieve below:
I create HTML Block and want to reuse it in different locations within one page.
For example, I create one small category list basic different types, And what I plan is:
1, to create the HTML Block to be one view file.
2, fetch the data by types, and assign the data to the Block view and shows in main page.(I load the Block view in main page view.)
3, back to step 2, load one more again to create one more category list in the same page.
I already googled it and some guys said can ues "$string = $this->load->view('BlockView',$data,true)" to get the html string and then resend to other view.
But I found, the $data will become undefined in the BlockView file. Any one came across this issue?
Or, any one can share his way to reuse the HTML Block? Thanks in advance!
Hi Guys,
I am thinking how to achieve below:
I create HTML Block and want to reuse it in different locations within one page.
For example, I create one small category list basic different types, And what I plan is:
1, to create the HTML Block to be one view file.
2, fetch the data by types, and assign the data to the Block view and shows in main page.(I load the Block view in main page view.)
3, back to step 2, load one more again to create one more category list in the same page.
I already googled it and some guys said can ues "$string = $this->load->view('BlockView',$data,true)" to get the html string and then resend to other view.
But I found, the $data will become undefined in the BlockView file. Any one came across this issue?
Or, any one can share his way to reuse the HTML Block? Thanks in advance!