• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I create a nested view within a nested view?

(09-27-2017, 06:58 AM)codeguy Wrote: @PaulD, You described your example as a view. I read it several times but my brain did not accept it. What confused me was you had four "$this->load->view() stmts in the example. My basic understanding for all the time I've spent learning CI is that a view is an html file or fragment. And "$this->load->view()" is a method of the CI controller class and therefore can only be invoked from within a controller. And so my brain told me I was looking at a controller - even though you clearly said it was an example of as view. If I can call the load method from within an html file (view) as your example shows then I think that makes the whole problem disappear. I'll try that.


Yes you can load views from within views. It really is that simple. As for the example I gave I was showing you can have lots of them in one view file, or even a loop to load various views if it helps, like for each table row in a table.


Messages In This Thread
RE: How do I create a nested view within a nested view? - by PaulD - 09-27-2017, 10:22 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.