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

#12
Thanks. I'm trying to implement a strategy from the several good suggestions I've read here. I now have:

Controller and page master view lib_page_view:

PHP Code:
$data3['tunes']=$this->M_tunes->getAllTuneData();
$this->load->vars($data3); //My attempt to cache $tune vars for use in file partials/topper_ssv in case previous line doesn't
$pgDataArr['tunes_sv']=$this->load->view('library_page/tunes_sv',$data3,TRUE);

//last controller stmt:
$this->load->view('library_page/lib_page_v',$pgDataArr);

//lib_page_v:
<?=$header_sv?>
<?=$lib_top_sv?>
<?=$filters_sv?>
<?=$az_jump_sv?>
<?=$tunes_sv?>
<?=$footer_sv?>

In sub view file tunes_sv.php:

PHP Code:
$this->load->view('partials/topper_ssv'); 

In sub, sub view file partials/topper_ssv:

PHP Code:
<div class="panel panel-tunes"
 
  <?php foreach ($tunes as $tune) { echo $tune->title."<br>";} ?> // To test this strategy
</div> 


I've tried several variations but always get
error: Severity: Notice
Message: Undefined variable: tune
Filename: partials/topper_ssv.php
Line Number: 3

Any idea what dumb thing I'm doing wrong?
Reply


Messages In This Thread
RE: How do I create a nested view within a nested view? - by codeguy - 09-28-2017, 10:25 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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